Returning -ErrorVariable defined in remote session invoked with invoke-command
Hi fellow PowerShellers,I'm trying to find a solution on how to get error variables defined in remote sessions, back to the local session. Let's say I do:Invoke-command -ComputerName testServer...
View ArticleHow to pass a query/get parameter in PSWS?
Hello all, I'm trying to get my head around PSWS/IIS OData extensions. I am having issues with how to pass parameters when doing a query/get to a function. The function is Called Get-MyUser in the...
View ArticleQuery Single User is Okay - Query from Array and I cannot get it to work -...
Hi All,Trying to query the property of "ActiveSyncAllowedDeviceIDs" from the cmdlet "Get-CASMailbox."I can get the short script to work with a single-user account, but cannot from a list of users in an...
View ArticleHelp getting registry key value using Credential's
I'm wanting to get a registry value from a remote server using certain credential's.Below is an example of how I can get the OS version$server = "SERVER" $reg = Get-WmiObject -List -Namespace...
View ArticleUse powershell variable in apostrophe
Hello,we try to create new management scopes withNew-ManagementScope -Name domain.com -RecipientRestrictionFilter {(CustomAttribute6 -eq 'domain.com')}If we want to use a variable instead of...
View ArticleError installing both PowerShell 3.0 and 4.0! Anyone?
Relevant System Information: Windows 7 SP1 - 64-bit .NET 4.0 and 4.5 both installed System currently at PowerShell 2.0I have tried running it with the System Update Readiness Tool but it didn't change...
View ArticleUsing an array item as a parameter in a path.
So I have an array that includes a name, folder, and port that I'm using to create IIS website.E.g. $site = "www.test.com","test",1234)I'm then trying to use the new-website command as...
View ArticleIssues with taking ownership and set-acl
I am trying to set the corporate desktop background for a Win 8 build. I understand there are two files called img0.jpg that need to be replaced. I have two issues, first is finding the files and...
View ArticleModifying XML with Powershell
I am new to modifying XML with PowerShell so please bare with me. ;-)You may or may not notice this is an XML file that is generate by the User Driven Installation Wizard as part of the MDT 2012...
View Articlehow can copy source path of share folder to another destination share folder...
Hihow can copy source path of share folder to another destination share folder from CSV file through PowerShell 2.0 or 3.0Also if possible, can I get the same share and security permission from source...
View ArticleHow best to manually install patches using enter-pssession -computername...
Hello, We do patching using a tool but sometimes patches do not install and we need to RDC to a server then double click the .exe/.msu patch file to get it to install. How can we utilize PowerShell...
View ArticlePass varibales from Ps1 script to xmla file
I have power shall script that runs the xmal script I need to pass the $Cube and $DatabaseId variables to xmla file to run on the cube. I can pass the $(DatabaseID) in .bat file. can I do it in...
View ArticleNew-ADUser "access to the attribute is not permitted"
The following code produces the error "New-ADUser : Access to the attribute is not permitted because the attribute is owned by the Security Accounts Manager (SAM)"$user = Get-ADUser -Identity...
View Articleintermittent : The term 'get-date' is not recognized as the name of a cmdlet,...
I have developed a batch harness whereby all scheduled tasks (W2012) invoke a common powershell script that acts as a wrapper to all our housekeeping jobs.The first step in the wrapper is to create a...
View ArticlePowerShell Desired State Configuration User Resource
Having problems getting the DSC User Resource working. Has anybody been able to get this resource working? If so then I can just assume I have to bang my keyboard some more.As I understand it, the...
View ArticleDetect smart files that are "online only"?
Is there a way to enumerate all files in a tree where the availability attribute is "online only"? I have an issue where a directory that was symbolicly linked in skydrive ended up with a bunch of...
View ArticlePS Script that can open GUI Interface for Object?
Hello,Is there anyway to open an object properties Window from RSAT : ADUC via powershell? If not, is there any programmatic alternative to doing this?Thanks
View Articlebatch/scripts file fro deleting files older than X days
Hi, can any one provide me with bath/script file for deleting files under a directory and its subdirectory without actually deleting directories.Files which are older than say 7 days.i need this...
View ArticleAD Module for Windows PowerShell - Insufficient Access Rights to perform the...
I have a recently upgraded domain that's now running all 2008R2 DCs. The domain functional level is 2008R2 and the forest functional level is 2003. I've also created a brand new lab domain with...
View ArticleGet-Acl command shows DomainName\Domian Users as default
Hi,I'm running (Get-Acl -Path C:\Foldername).Group and the output shows that domainname\Domain Users by default.I have changed the ownership to a specify users, but the output shows Domian Users as...
View Article