Location: Mail List

Ads

Skyscraper

The GPTalk Mailing List

The GPTALK mailing list is where you can send and receive email related to Windows Group Policy. You must subscribe to the list to send and receive mail from the list. The purpose of the list is to provide a forum for asking and answering technical questions related to Group Policy. Any question is fair game as long as it is related to Windows Group Policy.  The Archives for this list can be found on this page.

 

List Posts

Subject: [gptalk] Script Help
Prev Next
You are not authorized to post a reply.

AuthorMessages
mdzikowskiUser is Offline

Posts:68

01/29/2010 4:29 PM  
I have this working with a Domain Admin account...but I want this to run as a logon script for users. Any ideas?


On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Current User Name: " & WshNetwork.UserName

strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)

For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN


'Adds the currently logged on user to Citrix Test Group if they are in the POS TEST Users Group
Select Case strGroupName
Case "POS Test"
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
Const ADS_PROPERTY_APPEND = 3
set objGroup = GetObject("LDAP://CN=Citrix Test,OU=TEST OU,OU=Data Center,DC=TEST,DC=tds,DC=DOMAIN,DC=org")
objGroup.PutEx ADS_PROPERTY_APPEND,"member", Array(strUser)
objGroup.Setinfo
End Select
Next





Mike Dzikowski
WinTel Engineer
Henry Ford Health System | OneIT
2571 Product Drive | Rochester Hills, MI 48309
mdzikow1@hfhs.org<mailto:mdzikow1@hfhs.org>
248.853.4891


==============================================================================
CONFIDENTIALITY NOTICE: This email contains information from the sender that
may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise protected
from disclosure. This email is intended for use only by the person or entity
to whom it is addressed. If you are not the intended recipient, any use,
disclosure, copying, distribution, printing, or any action taken in reliance
on the contents of this email, is strictly prohibited. If you received this
email in error, please contact the sending party by reply email, delete the
email from your computer system and shred any paper copies.

Note to Patients: There are a number of risks you should consider before using
e-mail to communicate with us. See our Privacy Policy and Henry Ford My Health
at www.henryford.com for more detailed information. If you do not believe that
our policy gives you the privacy and security protection you need, do not send
e-mail or Internet communications to us.
==============================================================================

DarraghOShaughnessyUser is Offline

Posts:49

01/29/2010 4:29 PM  
Are the permissions on the target group allow POS TEST Users Group to
update it? Cant really see why you would want to do this?



Regards,



Darragh O'Shaughnessy

IT Services Department



E-Mail: darragh.oshaughnessy@vhi.ie
<mailto:darragh.oshaughnessy@vhi.ie>



Ext: 2562

Direct Dial In: 01-7994028



Web Site: www.vhi.ie



Help the environment. If you need to print this email consider using Eco
Font to save ink: http://www.ecofont.eu/ecofont_en.html
<http://www.ecofont.eu/ecofont_en.html>





This e-mail and any files transmitted with it contain information which
may be confidential and which may also be privileged and is intended
solely for the use of the individual or entity to whom it is addressed.
Unless you are the intended recipient you may not copy or use it, or
disclose it to anyone else. Any opinions expressed are that of the
individual and not necessarily that of Vhi Healthcare. If you have
received this e-mail in error please notify the sender by return. This
footnote also confirms that this e-mail message has been Swept for the
presence of computer viruses.



From: gptalk-owner@lists.gpoguy.com
[mailto:gptalk-owner@lists.gpoguy.com] On Behalf Of Dzikowski, Michael
Sent: 29 January 2010 16:27
To: gptalk@lists.gpoguy.com
Subject: [gptalk] Script Help



I have this working with a Domain Admin account...but I want this to run
as a logon script for users. Any ideas?





On Error Resume Next



Set objSysInfo = CreateObject("ADSystemInfo")

Set objNetwork = CreateObject("Wscript.Network")

Set WshNetwork = WScript.CreateObject("WScript.Network")

WScript.Echo "Current User Name: " & WshNetwork.UserName



strUserPath = "LDAP://" & objSysInfo.UserName

Set objUser = GetObject(strUserPath)



For Each strGroup in objUser.MemberOf

strGroupPath = "LDAP://" & strGroup

Set objGroup = GetObject(strGroupPath)

strGroupName = objGroup.CN





'Adds the currently logged on user to Citrix Test Group if they are in
the POS TEST Users Group

Select Case strGroupName

Case "POS Test"

Set objSysInfo =
CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName

Set objUser = GetObject("LDAP://" &
strUser)

Const ADS_PROPERTY_APPEND = 3

set objGroup =
GetObject("LDAP://CN=Citrix Test,OU=TEST OU,OU=Data
Center,DC=TEST,DC=tds,DC=DOMAIN,DC=org")

objGroup.PutEx
ADS_PROPERTY_APPEND,"member", Array(strUser)

objGroup.Setinfo

End Select

Next











Mike Dzikowski

WinTel Engineer

Henry Ford Health System | OneIT

2571 Product Drive | Rochester Hills, MI 48309

mdzikow1@hfhs.org

248.853.4891



========================================================================
======
CONFIDENTIALITY NOTICE: This email contains information from the sender
that
may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise
protected
from disclosure. This email is intended for use only by the person or
entity
to whom it is addressed. If you are not the intended recipient, any use,

disclosure, copying, distribution, printing, or any action taken in
reliance
on the contents of this email, is strictly prohibited. If you received
this
email in error, please contact the sending party by reply email, delete
the
email from your computer system and shred any paper copies.

Note to Patients: There are a number of risks you should consider before
using
e-mail to communicate with us. See our Privacy Policy and Henry Ford My
Health
at www.henryford.com for more detailed information. If you do not
believe that
our policy gives you the privacy and security protection you need, do
not send
e-mail or Internet communications to us.
========================================================================
======

mdzikowskiUser is Offline

Posts:68

01/29/2010 4:42 PM  
Well, I'm trying to "automate" some things. New users are being added to groups by our Access Administration team. However, they aren't doing it correctly. So, I want to just do it via a script and be done with it...

As a test I've actually given domain users (in my test lab) the rights to add self to group, still isn't workin'

Hmm

From: gptalk-owner@lists.gpoguy.com [mailto:gptalk-owner@lists.gpoguy.com] On Behalf Of Darragh O'Shaughnessy
Sent: Friday, January 29, 2010 11:29 AM
To: gptalk@lists.gpoguy.com
Subject: RE: [gptalk] Script Help

Are the permissions on the target group allow POS TEST Users Group to update it? Cant really see why you would want to do this?

Regards,

Darragh O'Shaughnessy
IT Services Department

E-Mail: darragh.oshaughnessy@vhi.ie<mailto:darragh.oshaughnessy@vhi.ie>

Ext: 2562
Direct Dial In: 01-7994028

Web Site: www.vhi.ie

Help the environment. If you need to print this email consider using Eco Font to save ink: http://www.ecofont.eu/ecofont_en.html


This e-mail and any files transmitted with it contain information which may be confidential and which may also be privileged and is intended solely for the use of the individual or entity to whom it is addressed. Unless you are the intended recipient you may not copy or use it, or disclose it to anyone else. Any opinions expressed are that of the individual and not necessarily that of Vhi Healthcare. If you have received this e-mail in error please notify the sender by return. This footnote also confirms that this e-mail message has been Swept for the presence of computer viruses.

From: gptalk-owner@lists.gpoguy.com [mailto:gptalk-owner@lists.gpoguy.com] On Behalf Of Dzikowski, Michael
Sent: 29 January 2010 16:27
To: gptalk@lists.gpoguy.com
Subject: [gptalk] Script Help

I have this working with a Domain Admin account...but I want this to run as a logon script for users. Any ideas?


On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
Set objNetwork = CreateObject("Wscript.Network")
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Current User Name: " & WshNetwork.UserName

strUserPath = "LDAP://" & objSysInfo.UserName
Set objUser = GetObject(strUserPath)

For Each strGroup in objUser.MemberOf
strGroupPath = "LDAP://" & strGroup
Set objGroup = GetObject(strGroupPath)
strGroupName = objGroup.CN


'Adds the currently logged on user to Citrix Test Group if they are in the POS TEST Users Group
Select Case strGroupName
Case "POS Test"
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
Const ADS_PROPERTY_APPEND = 3
set objGroup = GetObject("LDAP://CN=Citrix Test,OU=TEST OU,OU=Data Center,DC=TEST,DC=tds,DC=DOMAIN,DC=org")
objGroup.PutEx ADS_PROPERTY_APPEND,"member", Array(strUser)
objGroup.Setinfo
End Select
Next





Mike Dzikowski
WinTel Engineer
Henry Ford Health System | OneIT
2571 Product Drive | Rochester Hills, MI 48309
mdzikow1@hfhs.org<mailto:mdzikow1@hfhs.org>
248.853.4891


==============================================================================

CONFIDENTIALITY NOTICE: This email contains information from the sender that

may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise protected

from disclosure. This email is intended for use only by the person or entity

to whom it is addressed. If you are not the intended recipient, any use,

disclosure, copying, distribution, printing, or any action taken in reliance

on the contents of this email, is strictly prohibited. If you received this

email in error, please contact the sending party by reply email, delete the

email from your computer system and shred any paper copies.



Note to Patients: There are a number of risks you should consider before using

e-mail to communicate with us. See our Privacy Policy and Henry Ford My Health

at www.henryford.com for more detailed information. If you do not believe that

our policy gives you the privacy and security protection you need, do not send

e-mail or Internet communications to us.

==============================================================================

==============================================================================
CONFIDENTIALITY NOTICE: This email contains information from the sender that
may be CONFIDENTIAL, LEGALLY PRIVILEGED, PROPRIETARY or otherwise protected
from disclosure. This email is intended for use only by the person or entity
to whom it is addressed. If you are not the intended recipient, any use,
disclosure, copying, distribution, printing, or any action taken in reliance
on the contents of this email, is strictly prohibited. If you received this
email in error, please contact the sending party by reply email, delete the
email from your computer system and shred any paper copies.

Note to Patients: There are a number of risks you should consider before using
e-mail to communicate with us. See our Privacy Policy and Henry Ford My Health
at www.henryford.com for more detailed information. If you do not believe that
our policy gives you the privacy and security protection you need, do not send
e-mail or Internet communications to us.
==============================================================================

You are not authorized to post a reply.
Forums >GPTalk >GPTalk Mailing List > [gptalk] Script Help



ActiveForums 3.7

Members

MembershipMembership:
Latest New UserLatest:wetling
New TodayNew Today:1
New YesterdayNew Yesterday:1
User CountOverall:898

People OnlinePeople Online:
VisitorsVisitors:0
MembersMembers:0
TotalTotal:0

Online NowOnline Now:

Ads

Banner Inv
Copyright 2009 by GPOGUY.COM
Terms Of Use