header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
issue administrative credentials
Last Post 16 Dec 2009 10:36 AM by marcelo. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
marceloUser is Offline
New Member
New Member
Posts:1
Avatar

--
16 Dec 2009 10:36 AM
    I have a problem, I have the following script where you run as User common when the same place in the TS, and from the logon user need to check your printer session and share it and give permission to a particular group in the same print. with all necessary information, but need to change permissions of the Administrative credential lines
    $ result = $ COMP_IMP.Put ()
    and
    Setacl.exe-on "NOME_IMP $"-ot prn-ACTN ace-ace "n: $ HOSTNAME \ $ GROUP_NAME p: full"

    I tried various ways but without success. following the script:

    $NOME_IMPRESSORA = "HP Laserjet 1018"
    $COMP_IMPRESSORA = "HPLASER"
    $NOME_GRUPO = "impressao"

    $whoami = whoami
    $tokens = $whoami.split('\')
    $HOSTNAME = $tokens[0]
    $USERNAME = $tokens[1]

    query session $USERNAME | select-string -pattern $USERNAME > temp.txt
    $x = get-content temp.txt
    $x = [string]::join(" ", $x)
    $words = $x.split(" `t", [stringsplitoptions]::removeemptyentries)
    $SESSION_ID = $words[2]

    $HOST_CLIENT = cmd /c echo %CLIENTNAME%
    $IMP_SESSION = $NOME_IMPRESSORA
    $NOME_IMP = "$IMP_SESSION (de $HOST_CLIENT) na sessão $SESSION_ID"

    $COMP_IMP = Get-WmiObject -class win32_printer | where {$_.name -match "$NOME_IMPRESSORA"} | where {$_.name -match"sessão $SESSAO_ID"} | where {$_.name -match "de $HOST_CLIENT"}

    $COMP_IMP.sharename = "$COMP_IMPRESSORA"
    $COMP_IMP.shared = "0"
    $result = $COMP_IMP.Put()

    $GROUP_NAME = $NOME_GRUPO

    setacl.exe -on "$NOME_IMP" -ot prn -actn ace -ace "n:$HOSTNAME\$GROUP_NAME;p:full"
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer