Check "LOGON" Users 
Author Message
 Check "LOGON" Users

Dear All,

I am writing a script for check the User Name and assign the network drive
to user. I write the script as following:

Set WshShell = WScript.CreateObject("WScript.Shell")
LOGONUSER=WshShell.ExpandEnvironmentStrings("%USERNAME%")
WScript.Echo LOGONUSER

Set grp = GetObject("WinNT://SERVER1/GROUPNAME")
mem = grp.IsMember("WinNT://SERVER1/USERNAME")
WScript.Echo mem

I can get the Current User name at the FIRST WScript.Echo and compare the
user in group at the end of WScript.Echo  ( 0 or -1 code return). However,
how can I put the variable LOGONUSER to

        mem = grp.IsMember("WinNT://SERVER1/USERNAME")

Thanks and Best Regards,
Alex



Fri, 08 Oct 2004 12:09:36 GMT  
 Check "LOGON" Users
mem = grp.IsMember("WinNT://SERVER1/" & LOGONUSER)


Quote:
> Dear All,

> I am writing a script for check the User Name and assign the network drive
> to user. I write the script as following:

> Set WshShell = WScript.CreateObject("WScript.Shell")
> LOGONUSER=WshShell.ExpandEnvironmentStrings("%USERNAME%")
> WScript.Echo LOGONUSER

> Set grp = GetObject("WinNT://SERVER1/GROUPNAME")
> mem = grp.IsMember("WinNT://SERVER1/USERNAME")
> WScript.Echo mem

> I can get the Current User name at the FIRST WScript.Echo and compare the
> user in group at the end of WScript.Echo  ( 0 or -1 code return). However,
> how can I put the variable LOGONUSER to

>         mem = grp.IsMember("WinNT://SERVER1/USERNAME")

> Thanks and Best Regards,
> Alex



Fri, 08 Oct 2004 18:02:03 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Check "LOGON" User Group

2. adding user account to "Users" container

3. adding users to "Users" container

4. Logon using "system" or "network" user account

5. one user but "another user" error

6. In outlook 2000 "ThisOutlookSession", I need to logon to a MAPI Session

7. Help-"Error5-Logon Failed"-HELP PLease!!!!!!-Crystal Report

8. Logon "server"

9. Propertie "Allow logon to terminal server"

10. "Allow logon to terminal services" syntax

11. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

12. Client Side "Check All" script

 

 
Powered by phpBB® Forum Software