Is it possible to run a wscript against a group of computers? I have a script to determine the users default printer, but I can't figure out how to run it, or if there's another way to get the information
Announcement
Collapse
No announcement yet.
Run a wscript (user default printer)
Collapse
X
-
Re: Run a wscript (user default printer)
WScript.Echo GetDefaultPrinter
Function GetDefaultPrinter
sComputer = "."
Set oWMIService = GetObject("winmgmts:\" & sComputer & "\root\cimv2")
Set colItems = oWMIService.ExecQuery("Select * from Win32_Printer",,48)
For Each oItem in colItems
If (oItem.Attributes And 2^(3-1)) = 4 Then
sDefault = oItem.Name
Exit For
End If
Next
GetDefaultPrinter = sDefault
End Function
Comment
-
Re: Run a wscript (user default printer)
Try this to see if it gives you what you want without using your script:
Select a few computers in Hyena, then right-click and choose WMI->Execute Query->Printers. In the Where Clause box type in:
Default = 'True'
Click Execute Query.
Comment
-
Re: Run a wscript (user default printer)
That seems to be close to what I am trying to get. It returns what I assume is the default printer for the default profile. The information I'm trying to extract is the default printer for the current user. Not sure if that is possible.
Comment
Comment