Quantcast
Channel: PowerShell.org » All Posts
Browsing all 13067 articles
Browse latest View live

Reply To: Help – Combining Commands

I don’t have an Exchange environment to test this, but according to Get-Mailbox’s documentation, there’s an -OrganizationalUnit parameter which can be used to set the search root. Try something like...

View Article


Reply To: Help – Combining Commands

Give this syntax a try: Get-Mailbox -ResultSize unlimited -Filter {ExchangeUserAccountControl -eq 'AccountDisabled'} -OrganizationalUnit 'contoso.com/Whatever/Disabled Employees' Note the different...

View Article


Reply To: Help – Combining Commands

I tried that as well. No luck.

View Article

Reply To: Installing an exe with Powershell DSC Package resource gets return...

Jay, We don’t use Perforce at work but I’ve downloaded the latest version and after some fun + games figured out that the InstallShield setup wrapper puts the MSI file into wrong path if you execute...

View Article

Reply To: Installing an exe with Powershell DSC Package resource gets return...

That did it! Thanks so much Daniel!

View Article


Reply To: Installing an exe with Powershell DSC Package resource gets return...

I’ve run in to the need to validate behavior running as System quite a lot. I keep these two lines handy. Start-BitsTransfer http://live.sysinternals.com/psexec.exe .\ .\psexec.exe -s PowerShell.exe...

View Article

Reply To: Optimze-Volume Schedule.(storage Mangement)

Thank You, David. This helps a lot, At least I can pull this from all my machines and figure out which ones need to be changed. between you and Anna’s script, I should be able to knock out this...

View Article

Reply To: xSmbShare resource on Windows Server 2008 R2

I’m struggling with the same thing. I need to create a share on a Windows 7 machine, so xSmbShare will not work for me. You can use the “net share” command to do this, but I can’t figure out how to...

View Article


How can I make the WindowsProcess resource idempotent?

How can I make a WindowsProcess resource idempotent, so that I can run it many times without failing? Here is a specific example (but my question is more in general): WindowsProcess CreateTestShare {...

View Article


Reply To: How can I make the WindowsProcess resource idempotent?

Process is the wrong resource to use here. As you’ve pointed out, you’re telling DSC that there should always be an instance of “net.exe” running, which doesn’t really make any sense. What you would...

View Article

Reply To: How can I make the WindowsProcess resource idempotent?

I would use the Script resource instead. You can use a PowerShell snippet to check if the share exists (GetScript) and your net.exe call as SetScript.

View Article

Reply To: Help – Combining Commands

well without asking you to share the full code you’re using (obviously you don’t need to share your OU), I would first confirm that the OU you’re specifying does actually exist. Load the...

View Article

Reply To: How can I make the WindowsProcess resource idempotent?

Agreed. The script resource is the way to go if you’re not building custom.

View Article


Reply To: Help – Combining Commands

Have you tried turning it upside down? Query your own AD for the users you want, then query Office Online for their mailboxes using the AD user objects’ UserPrincipalNames. $users = Get-ADUser...

View Article

Image may be NSFW.
Clik here to view.

Reply To: Correct usage of [Validatenotnullorempty]

@Mike – I agree using validatescript that returns true\false is a nice trick. I had picked it up from a script posted by jeff hicks i think, cannot remember the link though but thanks for posting it;...

View Article


Reply To: PowerShell DSC – Compliance Server: What's the Deal?

The powershell team made a post recently about what it is and how to use it for retrieving node information...

View Article

Reply To: Help – Combining Commands

Peter, the OU does in fact get returned. I also have AD open while I’m writing this script. Thanks for helping me confirm that I’m not crazy, though. As far as selecting the specific usernames, there...

View Article


Reply To: How can I make the WindowsProcess resource idempotent?

Hey Jay, If you put together a script resource to do this (Get/Set/Test-TargetResource functions), would you mind sharing this? As you can see from my earlier post, I need to do this as well. Thanks,...

View Article

How do I catch this?

I’m trying to modify a script that check the size of folders in a particular path, but get an error message when it hits a folder of zero bytes. Is there a way to use a Try Catch to suppress the error...

View Article

Reply To: How do I catch this?

You’ve got a typo. You’re missing a period after the $_. That’s why it’s including folders.

View Article
Browsing all 13067 articles
Browse latest View live