Reply To: Write-Host vs Write-Output
Why not simply use write-warning or write-error if the ping fails?
View ArticleReply To: Write-Host vs Write-Output
I think it’s about the principles of tool design. If that was my goal, I’d write one function named Test-ICMP. That would do the ping, and output objects to the pipeline by using Write-Output. I’d...
View ArticleReply To: Write-Host vs Write-Output
His legacy is about so much more than dead puppies, just saying! -VERN
View ArticlePiping output from -whatif to a file
Hello, I am sure this is a beginner question here but I am unable to find anything online about it. I am trying to disable user accounts that have not logged into the domain for over 10 days. I am...
View ArticleReply To: Piping output from -whatif to a file
To search a particular OU use the -SearchBase parameter to define the OU (by distinguished name) Whatif appears to be similar to write-hoist in that it writes directly to screen. One suggestion would...
View ArticleSplitting text file with separators
Hello! I have a text file which contains 4 sections separated by strings with specific patterns. The file is being updated irregularly, manually and by several people. I wrote a script which allows me...
View ArticleReply To: Compare two locations, report on differences
Hey Daniel, would you be able to attach “TF.iQmetrix.CheckinPolicies.txt” or post the contents of it? Is there a way to grab the last part of the line up to the 1st space? What i actually need are the...
View ArticleReply To: Using CIM to create a shared folder
Unfortunately, this is a non-trivial task. Its something I’ve been meaning to look at for a while so if you can give me a bit of time I’ll see if I can come up with an answer.
View ArticleReply To: Splitting text file with separators
Sure: ####tagfile############### #Passed tags =OK======================== pass1 pass2 pass3 #For reviewing =NS======================== rev1 rev2 rev3 #Not passed =NK========================= notok1...
View ArticleReply To: Piping output from -whatif to a file
Hello Matthew, You don’t need to use -WhatIf to get the expected result for your review. The Search-ADAccount cmdlet returns ADUser objects with the Enabled property which you can use to filter for...
View ArticleReply To: Using CIM to create a shared folder
btw do you know if there are any books on powershell and cim?
View ArticleReply To: Using CIM to create a shared folder
There’s my PowerShell and WMI (http://manning.com/siddaway2) It was written in the early days of PowerShell v3 and has chapters specifically on the CIM cmdlets and CDXML. The bulk of the book use...
View ArticleReply To: Using CIM to create a shared folder
I’ve got this function working to add a standard share permission (read, change or full control) to a share #requires -Version 3.0 function Add-SharePermission { [CmdletBinding()] param (...
View ArticleReply To: Installing .MSU Via Powershell & PSexec
Gosh I must have been sleeping when I wrote my last post… I see what I did wrong, essentially I did not set the computername parameter for Wet-WMIObject therefore the OS architecture would always come...
View ArticleReply To: Installing .MSU Via Powershell & PSexec
Hey Peter Really mate don’t know how to thanks you, I was gonna reply today to tell you that mission accomplished and I’m ready for the mass deploy. I finished writing the script yesterday and I’ve...
View ArticleMedia for the Summit?
I am trying to promot the PowerShell Europe summit in various channels here in Sweden. A picture always helps… so I am wondering. Do we have any “offcial” logos that we can/should use? The new lgo is...
View ArticleReply To: Using CIM to create a shared folder
Thanks Richard. It’s too bad that it wasn’t doable with CIM. I ended up using some of the info in your example and some for an example i found on the Microsoft script gallery and came up with this....
View ArticleConfiguration "chicken and egg" problem
I built a custom DCS resource for use in configuring IIS 7.5 using two cmdlets in the WebAdministration module – Get-WebConfigurationProperty and Set-WebConfigurationProperty. Have it working just...
View Article