More regex help
I'm trying to match this:/tags/ud617/?sort=active&page=2" >2The closest I've come is:[regex]::matches($mystring,'/tags/ud617/\?sort=active&page=\d+')The above only matches this...
View ArticleHow to filter on an extended attribute?
Hi,Trying to list all groups with nothing populated in the HomePage extended attribute. So Im trying to filter as early as possible in the Get-Adgroup cmdlet as follows:Get-Adgroup -Filter 'Homepage...
View ArticleShow AD group members using Get-QADGroup
Hi, Im trying to output a list of member of a particular AD group. So far Ive got Get-QADGroup -IncludeAllProperties -Name WestFinance | select -expand AllMembers that works fine, but..1. when I...
View ArticleReplace Everything After "=" In File BUT Only For Specific Variable In File
I have a file that contains the following:baseHostname=record.site.com username=user password=passwordWhat I am attempting to do is replace everything to the right of the "=" ONLY IN...
View ArticlePrompt For Choice
Hi guys!I've this little problem: i want to set a default value (YES) in my function if elapsed time >15" (or when the function is scheduled) My function is this:Function Get-Choice{ Param(...
View ArticlePopulate a dataset in a foreach loop
Hi,I am trying to populate a dataset in foreach loop, but I have difficulties getting it working.I have a set of plan_handles in a dataset. Now I want to go through them and execute a query to get the...
View ArticlePowershell: Binary Modules vs Script Modules
I'm writing a Build Process (wrapping msbuild in my module) for 350+ projects (VS 2010). This module now includes lots of Functions. Although, it is working efficently, but , I've started considering...
View Articlescripts
Hi Can someone tell me scripts for the following in powershell 3.0 1. Reboot Script 2. Multiple VHD creation scripts. 3. Creation of multiple VMs 4. Hibernate-Resume Script 5. Sleep-Resume Script 6....
View ArticleAudit ACL on Large File Share
I have to audit the permissions of all folders on a large drive, and I was wondering if the following code is really practical with this many possible folders.$ntfsreport = @() $folders = Get-ChildItem...
View Article"Split" a recursive function
Hi guys!I've got 2 pc: one have Powershell V3, the other one have Powershell V2.I've got a recursive function (Function A{... A ...}); with PS v3 there aren't problems , with PS v2 i've got a maximum...
View ArticlePass login credentials into a test-path cmdlet
Here is the scenario. I'm creating a SQL Server Job that will use Powershell to test if a session could be made to a remote server before creating one. I was able to successfully create a cmdlet that...
View Articleplay sound on a remote computer with powershell
hey there! i have a hostmonitor server and another monitor station. i neet to play an alarm sound on the station whenever there is some error.is it posibol to do it?how can i connect from the server...
View ArticleCannot start script with Exchange snapin.....
I'm trying to run this simple script:import-module activedirectory add-pssnapin microsoft.exchange.management.powershell.admin add-adgroupmember -identity "gbl-ap-user-aw users" -member "atest1"...
View ArticleSetting Scope HyperV 2012 R2 What replaced ScopeOfResidence?
Basically, I want to know how to set the scope for a hyper-v vm in Server 2012 R2. I work at an academic institution, we intend to upgrade our 2008 R2 servers to 2012 R2 but before we can do that we...
View Articleappend a folder path to a folder
Does anyone know how to append a folder path tp a folder using my code below, what am i doing wrong$archive = 'c:\archive\' #Make Destination Datestamp Folder New-Item -Path $archive -ItemType...
View ArticleHow to pull files or folders
Hey all so I need to get some SCCM log files from a few hundred machines in a few labs. I really have no idea how to get a file and how to store it on my computer.Get-ChildItem...
View Articlelogin to website using powershell
Hi All,Is it possible to use HTTP GET and POST method in powershell and login to a website by entering username, password, domain and click on login button?
View ArticleHow to "Continue" in a Process Block?
I can't seem to figure out a way to properly skip the rest of the Process Block without completely exiting it. Take the following as an example:function Test { Begin { $i = 1 } Process { if ($i -eq...
View ArticleStart remote registry service, get registry key and then stop service
I am trying to get the version of a software off of a number of computers. The remote registry service is stopped so I wrote a powershell command to start the service, get the key value and then stop...
View ArticleRemove all groups from one user
I need a Powershell script using native or Quest cmdlets to remove ALL groups from a user in AD. Now here's the catch, the user is a member of groups from 3 different trusted domains in a single...
View Article