This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim TheRoot, TheDisplay, TheContext, TheMenu, TheLoop, TheNewMenu | |
set TheRoot = Getobject(LDAP://RootDSE) | |
set TheContext = GetObject("LDAP://" & "CN=409, CN=DisplaySpecifiers," & TheRoot.get("configurationNamingContext")) | |
Set TheDisplay = TheContext.GetObject("displaySpecifier","cn=user-Display") | |
TheLoop = 0 | |
If Not IsEmpty(TheDisplay.adminContextMenu) Then TheMenu = TheDisplay.GetEx("adminContextMenu") | |
For TheLoop = LBound(TheMenu) to UBound(TheMenu) | |
If InStr(TheMenu(TheLoop),"&Default Printer") Then | |
MsgBox "Menu already exists ... exiting ..." | |
WScript.Quit | |
End If | |
Next TheLoop = TheLoop + 1 | |
End If | |
TheNewMenu = CStr(TheLoop) & ",&Default Printer...,defaultPrinterAdmin.vbs" | |
TheDisplay.PutEx 3,"adminContextMenu" , Array(TheNewMenu) | |
TheDisplay.SetInfo | |
Set TheDisplay = Nothing | |
Set TheContext = Nothing | |
Set TheRoot = Nothing | |
MsgBox "Added Admin Context Menu item" | |
WScript.Quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment