Wednesday, August 03, 2005 5:24 PM
mika
WS03 User based auditing & simple logon script to connect printers
A relaxing summer vacation is over. I managed to stay away from computers for most of the three weeks’ period J Prior to that I participated my first TechEd in Amsterdam and enjoyed it tremendously. Lot’s of interesting stuff and I also met a lot of nice people. My special thanks go to Ronald Beekelaar for organizing work for us to do!
Last week I couldn’t resist the temptation of installing beta 1of Vista. It was working surprisingly smoothly on VMware 5.0 guest on the internal hard disk of my laptop following Ipsi2000’s tips on http://www.vmware.com/community/thread.jspa?threadID=19960&start=15. On Monday this week I also installed Longhorn Server Beta 1 on Virtual PC 2004 SP1 guest and after installing VPC additions, things were rolling smoothly on that machine as well J I’m not sure what went wrong but I had to create the system partition with Windows Server 2003 Setup CD before setup continued past partition selection.
I thought I’d share few things. First off is the Windows Server 2003 user based auditing (officially called Per-User Selective Audit). I initially learned about it a long time ago but never figured out how to make it work. Now there is an article on this topic in the July issue of Windows IT Pro magazine. Unfortunately, you can only see the beginning (http://www.windowsitpro.com/Windows/Article/ArticleID/46625/46625.html) unless you’re a subscriber. Fortunately, there is information on this topic almost directly from Redmond on Windows auditing team’s blog (http://blogs.msdn.com/ericfitz/archive/2004/12/20/327478.aspx). To summarize, the built-in command auditusr can be used in Windows Server 2003 SP1 and XP SP2 to include or exclude certain user(s) from auditing of other categories than object or directory access. The command simply wasn’t there in Windows Server 2003 RTM (Released to Manufacturing) so no wonder I couldn’t find it…
The second issue to share is a basic logon script for connecting two printers for certain users. Used with the (Computer configuration\Administrative Templates\System\Group Policy\)User Group Policy Loopback Processing group policy setting in Merge mode, it is easy to connect two printers for users based on the location of computer object (rather than user object which is the default behaviour) in the OU structure. The script is here:
Option Explicit
On Error Resume Next
Dim wshShell,ConnectPrinter1,ConnectPrinter2,SetDefaultPrinter
Set wshShell = WScript.CreateObject("WScript.Shell")
ConnectPrinter1 = "rundll32 printui.dll,PrintUIEntry /in /n\\printserver\printer1 /q"
SetDefaultPrinter = "rundll32 printui.dll,PrintUIEntry /y /n\\printserver\printer1"
ConnectPrinter2 = "rundll32 printui.dll,PrintUIEntry /in /n\\printserver\printer2 /q"
wshShell.Run ConnectPrinter1,0,True
wshShell.Run ConnectPrinter2,0,True
wshShell.Run SetDefaultPrinter,0,True
Set wshShell = Nothing
WScript.Quit()
Thanks for Kari Lehtinen in Hyvinkää for helping to fully utilize the power of the script! BTW, you can find the syntax and examples of the command by running (Start - Run)
rundll32 printui.dll,PrintUIEntry /?
The parameter is case-sensitive!
Filed under: Security, Active Directory