thenrich
asked on
Login script
Is there a login or logout script to capture everybodys current drive mappings?
What type of output are you looking for, writing to a text file or something along those lines?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I'd like to write to a file based on the user login name.
You Can use this command :
net use > C:\%USERNAME%
net use > C:\%USERNAME%
Create a batch file with the above command and run it as a logon script using a GPO.
drives.cmd
=========
net use > \\server\share\%username%. txt
Thanks,
Raj
drives.cmd
=========
net use > \\server\share\%username%.
Thanks,
Raj
ASKER
If I could just get a script that would wite file with the drive mappings vs a single line of code that would be great.
That single line of code IS the script. :-)
Just create the file drives.cmd in your SYSVOL\DOMAIN\scripts share on the DC and run it as a logon script for all users using the default domain group policy.
This will create individual text files with username.txt under the \\server\share you specify.
Just create the file drives.cmd in your SYSVOL\DOMAIN\scripts share on the DC and run it as a logon script for all users using the default domain group policy.
This will create individual text files with username.txt under the \\server\share you specify.
net use | findstr /i /r Windows > \\server\share\%USERNAME%
Careful with using the above, as it will not log all the lines when the share path is longer than 25 chars.