To start we can get the names of all of the local user accounts on an endpoint with the following relevance:
"names of local users"
To get that for all of your endpoints you would make a new analysis in your BigFix console with a property called something like, “Local Users” and that relevance statement as the value of the property of the analysis.
On my test endpoint this returns:
Q: names of local users
A: Administrator
A: DefaultAccount
A: Guest
To search for specific users you can use:
exists (names of local users) whose (it = "Testname" or it = "testname2")
On my test endpoint this happens:
Q: exists (names of local users) whose (it = "Testname" or it = "testname2")
A: False
… because I don’t have a testname or testname2 user. Though, if I tweak the relevance to check for an Administrator account:
Q: exists (names of local users) whose (it = "Administrator" or it = "testname2")
A: True
So now we have the relevance part – we know how to check if the account exists.
So make a new fixlet with this as its relevance:
Q: exists (names of local users) whose (it = "Insert Admin Account 1 name here" or it = "Insert Admin Account 2 name here")
A: True
For the Action Script of the fixlet we will call the net user command to remove the user accounts.
Normally we’d use a, “Waithidden” command to make sure the commands finish but in this case we don’t really need to and can use the following action script:
Runhidden net user "Insert Admin Account 1 name here" /delete
Runhidden net user "Insert Admin Account 2 name here" /delete