Coming soon - Get a detailed view of why an account is flagged as spam!
view details
10
I need my script to tell me which computers don't have a specific local account
Post Body

So in trying to figure out how to write a script to do what I want I have inadvertently done the exact opposite. The code below takes the list of computers and goes through them and reports back if the computer does have myadmin account. But I need it to report the computers that don't have the myadmin local account.

$computers = get-content c:\scripts\computers.txt

$ErrorActionPreference = 'SilentlyContinue'

Param ([string[]]$computers)
 $(foreach ($comp in $computers){
get-ciminstance win32_useraccount -filter "name='myadmins'" -ComputerName $comp | 
Select Domain,Name |  
Export-CSV c:\Scripts\myadmins.csv -Append
})

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
Yes
Total Karma
66,614
Link Karma
30,920
Comment Karma
35,639
Profile updated: 6 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago