Posts

Showing posts with the label list mapped drives DOS command line batch file logon script startup script programatically show printers list

Simple domain logon script to capture locally mapped drives and printers

I have a project where I need to deploy Group Policy Preferences to replace statically mapped drives and printers.  Unfortunately, nobody really knew too much about the environment.  Login scripts weren't in place.  People were connecting to printers however they figured out how to do it. I needed to be able to come up with some structure to map shares (OU, groups, etc).  I needed to tie printers to PCs and drive mappings to users. I went as simple as I could.  I added a simple batch file as a logon script to the domain policy which was the only policy active in the Active Directory forest. REM=======Script ======== @echo off net use  >> \\server\share\%COMPUTERNAME%_%USERNAME%.txt date /T >> \\server\share\%COMPUTERNAME%_%USERNAME%.txt cscript \\domain\netlogon\prnmngr.vbs -l \\server\share\%COMPUTERNAME%_%USERNAME%.txt REM ===========END of Script =================== Notice prnmngr.vbs?  That's a Windows X...