First you need to determine if this is a user account (domain or local) or a security group. Usually, I find this to be a domain security group where a domain admin will add users so they can have administrator rights to their local computer to run programs that do not play nice – requiring local admin rights to run.
If it is a security group you can create a logon script some thing like:
Write back and give more details if you need additional help
You can delete with the NET command from a script or use something like WMI remotely. There are some utilities available that can be run remotely for managing accounts / groups.
In a script, you could set the command to run as a scheduled task or use PSEXEC if that is allowed in your environment.
The login script is probably not the place unless all users are admins on their system.
You can create a script that takes a list of your computers, run it under an account that has administrative access to your systems and let it schedule removal of the account.
schtasks /create /tn DelAdmin /tr "cmd /c net user admin /delete" /sc once /st HH:MM [/sd MM/DD/YYYY] /ru "NT AUTHORITY\SYSTEM" /s ComputerName /F
at \\ComputerName "cmd /c net user admin /delete"
Script with for loop to process list of system names left for the administrator.
They are not domain account. Admin Account is local computer account for which someone used to configure the PC for joining into the domain. I have about 200 computer in the network.
I have never done scripting. Can you please give me the whole script which i can run on my PC or from my Server i can schedule it and that will delete the user. That will be really appreciated. Thanks