| Author | Messages | |
mdzikowski
Posts:61
 | | 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. ==============================================================================
| | | |
| DarraghOShaughnessy
Posts:18
 | | 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. ======================================================================== ======
| | | |
| mdzikowski
Posts:61
 | | 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. ==============================================================================
| | | |
|
|