Frank – you can use WMI to enumerate the printers, here is a _vbscript_ that will run your command against each shared printer.  Save it as a vbs and run it with the server name as an argument, i.e.

 

printers.vbs printsvr1

 

‘begin script -------------

On Error Resume Next

 

Dim objShell, objArgs, objWMIService, objItem

Dim strComputer, strPrinter, colItems

 

Set objShell = WScript.CreateObject ("WScript.Shell")

Set objArgs = WScript.Arguments

strComputer = objArgs(0)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select ShareName from Win32_Printer",,48)

 

For Each objItem in colItems

      strShareName = objItem.ShareName

      If strShareName <> "" Then

            strPrinter = "\\" & strComputer & "\" & strShareName

            objShell.run("subinacl /printer " &_

 strPrinter & " /grant=" & chr(34) & "WSADMINS" & chr(34))

      End If

Next

‘end script -----------------

 

Rich

 

 

-----------------------------------------------------------

From: [EMAIL PROTECTED] on behalf of Frank Abagnale

Sent: Thu 10/13/2005 2:38 AM

To: Active

Subject: [ActiveDir] Subinacl print queue

 

 

Hi,

 

I need to grant a security group permissions to every print queue on a Print

Server.

 

I have looked at SUBINACL and I can use this to grant access to each print

queue providing I know the name of the queue. e.g,

 

subinacl /printer \\printsvr1\USATPR001  /grant="WSADMINS"

 

The issue I have is that I don't know the name of every print queue, is there

someway I can use a wildcard to allow this command to be run against every

print queue listed on the server?

 

thanks frank

 


-------APPLEBEE'S INTERNATIONAL, INC. CONFIDENTIALITY NOTICE-------
PRIVILEGED / CONFIDENTIAL INFORMATION may be contained in this message or any attachments. This information is strictly confidential and may be subject to attorney-client privilege. This message is intended only for the use of the named addressee. If you are not the intended recipient of this message, unauthorized forwarding, printing, copying, distribution, or using such information is strictly prohibited and may be unlawful. If you have received this in error, you should kindly notify the sender by reply e-mail and immediately destroy this message. Unauthorized interception of this e-mail is a violation of federal criminal law. Applebee's International, Inc. reserves the right to monitor and review the content of all messages sent to and from this e-mail address. Messages sent to or from this e-mail address may be stored on the Applebee's International, Inc. e-mail system.


Reply via email to