Subinacls has issues with spaces and is used in Rich's script. When doing files I didn't find a fast way around and had to use the 8.1 name. Sucks - doesn't it?
 
Ulf


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Frank Abagnale
Sent: Tuesday, October 18, 2005 3:45 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Subinacl print queue

Rich,
 
I noticed that the script does not work against Printers which have spaces between their share names. e.g for a Printer called USATPR001 it works fine, but for a printer which share name is US NY PRT 05 it fails, I assume it's because of the spaces.
 
What would I need to allow the script to understand names with spaces between them?
 
thanks...
Frank

 

 

 


Rich Milburn <[EMAIL PROTECTED]> wrote:

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.



Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Reply via email to