PC Review Forums Newsgroups Windows XP Windows XP WMI Local Goup membership

Reply

Local Goup membership

 
Thread Tools Rate Thread
Old 11-06-2007, 08:17 AM   #1
=?Utf-8?B?YWtoZGFy?=
Guest
 
Posts: n/a
Default Local Goup membership


Hi friends,
can any one help me to create a scripte to list local administrators group
on domain computers.
Thanks
  Reply With Quote
Old 11-06-2007, 04:44 PM   #2
Jeffery Hicks
Guest
 
Posts: n/a
Default Re: Local Goup membership

akhdar wrote:
> 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."

  Reply With Quote
Old 27-06-2007, 12:44 PM   #3
=?Utf-8?B?Q2FybG9z?=
Guest
 
Posts: n/a
Default Re: Local Goup membership

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

"Jeffery Hicks" wrote:

> akhdar wrote:
> > 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."
>
>

  Reply With Quote
Old 27-06-2007, 09:18 PM   #4
Jeffery Hicks
Guest
 
Posts: n/a
Default Re: Local Goup membership

Carlos wrote:
> 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
>
> "Jeffery Hicks" wrote:
>
>> akhdar wrote:
>>> 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."
>>
>>


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."

  Reply With Quote
Old 28-06-2007, 07:18 AM   #5
=?Utf-8?B?Q2FybG9z?=
Guest
 
Posts: n/a
Default RE: Local Goup membership

Thank you Mr. Jeffrey

"akhdar" wrote:

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

  Reply With Quote
Old 06-04-2008, 08:12 AM   #6
guzarva16
Guest
 
Posts: n/a
Default RE: Local Goup membership



"akhdar" wrote:

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

  Reply With Quote
Old 06-04-2008, 08:15 AM   #7
guzarva16
Guest
 
Posts: n/a
Default Re: Local Goup membership



"Jeffery Hicks" wrote:

> Carlos wrote:
> > 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
> >
> > "Jeffery Hicks" wrote:
> >
> >> akhdar wrote:
> >>> 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."
> >>
> >>

>
> 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."
>
>

  Reply With Quote
Old 06-04-2008, 08:15 AM   #8
guzarva16
Guest
 
Posts: n/a
Default Re: Local Goup membership



"Carlos" wrote:

> 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
>
> "Jeffery Hicks" wrote:
>
> > akhdar wrote:
> > > 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."
> >
> >

  Reply With Quote
Old 06-04-2008, 08:15 AM   #9
guzarva16
Guest
 
Posts: n/a
Default Re: Local Goup membership



"Jeffery Hicks" wrote:

> akhdar wrote:
> > 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."
>
>

  Reply With Quote
Old 06-04-2008, 08:16 AM   #10
guzarva16
Guest
 
Posts: n/a
Default RE: Local Goup membership



"Carlos" wrote:

> Thank you Mr. Jeffrey
>
> "akhdar" wrote:
>
> > Hi friends,
> > can any one help me to create a scripte to list local administrators group
> > on domain computers.
> > Thanks

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off