Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell - Output results to STDOUT

$
0
0

Hi all,

Very new to Powershell and Script Deployment. We are trying to remove any rogue Local Admin accounts we have out in the field via PS Script. I've found a script online and input the exclusion admin accounts. The code has been tested on a few machines and it removes any admin accounts not listed in the code so all appears to be working fine.

However I'd like to output the usernames of any deleted users to STDOUT. At present we only get "The command completed successfully."

I've inserted the code but I'm looking for help in outputting the usernames.......Thanks!

Powershell
functionGet-GroupBySid(){param([parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)][Alias("Name")][string]$ComputerName,[string]$GroupNameSid="S-1-5-32-544")$objSID=New-ObjectSystem.Security.Principal....

Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>