Local Goup membership

G

Guest

Hi friends,
can any one help me to create a scripte to list local administrators group
on domain computers.
Thanks
 
J

Jeffery Hicks

akhdar said:
Hi friends,
can any one help me to create a scripte to list local administrators group
on domain computers.
Thanks

This is very easy using ADSI and the WinNT provider:

strComputer="someserver"
Set objLocalAdmins=GetObject("WinNT://" & strComputer &
"/Administrators,Group")

Set memberList=objLocalAdmins.Members
For Each member In memberList
WScript.Echo member.name
Next

--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified.

blog: http://blog.SAPIEN.com
Community: http://www.scriptinganswers.com
Training: http://www.ScriptingTraining.com
Books: http://www.SAPIENPress.com
Editor: http://www.primalscript.com
Tools: http://www.scriptingoutpost.com

"Those who forget to script it are doomed to repeat it."
 
G

Guest

Hi Mr. Jeffrey Hicks,
I also need this script, I tried it and it works.
I have use a script from the repository to connect the AD and retrieve all
the computer accounts. Then, I used your script below to connect to the
individual computer and detect who are the members of administrators group in
each computer. However, If the computer that I wish to connect is updated
with SP2 and Firewall is On and Exception File and Print Sharing is OFF, I
can not connect to that machine any more.

My problem now, is how I can turn on the Exception File and Print Sharing to
a remote PC? Or do you have any suggestion on how I can connect to that
computer?

Thanks
 
J

Jeffery Hicks

Carlos said:
Hi Mr. Jeffrey Hicks,
I also need this script, I tried it and it works.
I have use a script from the repository to connect the AD and retrieve all
the computer accounts. Then, I used your script below to connect to the
individual computer and detect who are the members of administrators group in
each computer. However, If the computer that I wish to connect is updated
with SP2 and Firewall is On and Exception File and Print Sharing is OFF, I
can not connect to that machine any more.

My problem now, is how I can turn on the Exception File and Print Sharing to
a remote PC? Or do you have any suggestion on how I can connect to that
computer?

Thanks

You can do most of that via Group policy. Otherwise you have to
manually configure the desktop because you can't get to it remotely to
make the changes!

--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified.

blog: http://blog.SAPIEN.com
Community: http://www.scriptinganswers.com
Training: http://www.ScriptingTraining.com
Books: http://www.SAPIENPress.com
Editor: http://www.primalscript.com
Tools: http://www.scriptingoutpost.com

"Those who forget to script it are doomed to repeat it."
 
G

guzarva16

Jeffery Hicks said:
You can do most of that via Group policy. Otherwise you have to
manually configure the desktop because you can't get to it remotely to
make the changes!

--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified.

blog: http://blog.SAPIEN.com
Community: http://www.scriptinganswers.com
Training: http://www.ScriptingTraining.com
Books: http://www.SAPIENPress.com
Editor: http://www.primalscript.com
Tools: http://www.scriptingoutpost.com

"Those who forget to script it are doomed to repeat it."
 
G

guzarva16

Carlos said:
Hi Mr. Jeffrey Hicks,
I also need this script, I tried it and it works.
I have use a script from the repository to connect the AD and retrieve all
the computer accounts. Then, I used your script below to connect to the
individual computer and detect who are the members of administrators group in
each computer. However, If the computer that I wish to connect is updated
with SP2 and Firewall is On and Exception File and Print Sharing is OFF, I
can not connect to that machine any more.

My problem now, is how I can turn on the Exception File and Print Sharing to
a remote PC? Or do you have any suggestion on how I can connect to that
computer?

Thanks
 
G

guzarva16

Jeffery Hicks said:
This is very easy using ADSI and the WinNT provider:

strComputer="someserver"
Set objLocalAdmins=GetObject("WinNT://" & strComputer &
"/Administrators,Group")

Set memberList=objLocalAdmins.Members
For Each member In memberList
WScript.Echo member.name
Next

--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified.

blog: http://blog.SAPIEN.com
Community: http://www.scriptinganswers.com
Training: http://www.ScriptingTraining.com
Books: http://www.SAPIENPress.com
Editor: http://www.primalscript.com
Tools: http://www.scriptingoutpost.com

"Those who forget to script it are doomed to repeat it."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top