First we will take our
input.
We need domain in order
to search for the user in the Active Directory the remote computer we want to
add the user as admin into and the username of the user who want to be the
admin.
Now we want to
get inside the local Administrator group inside the remote computer.
In order to
do it we will use the [ADSI] adapter.
Explanation:
ADSI stands for Active Directory® Services Interface.
Despite the name, ADSI isn’t actually specific to Active Directory.
…
ADSI can connect to a variety of directory
services, including Windows NT®-style
directories—not just Windows NT domains, mind you, but also to the local
Security Accounts Manager (SAM) on standalone and member computers.
…
As the name implies, a type adapter
"adapts" a .NET Framework object type into a more consistent, and
sometimes simpler, format.
For more information you can visit the great post of Don
Jones at:
We will use this adapter in order to access the local
administrator group in the remote computer:
After we have the group we will add the user:
אין תגובות:
הוסף רשומת תגובה