File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
WinPrintManagement/Printers Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 117
117
' AuthType' = $AuthType
118
118
' Identity' = $Script :User
119
119
}
120
+ if ($null -ne $DomainAccount ){
121
+ $cmdArgs.Add (" Credential" , $DomainAccount )
122
+ }
120
123
if ($UnLock -eq $true ){
121
124
if ($Script :User.LockedOut -eq $true ){
122
125
Unlock-ADAccount @cmdArgs
Original file line number Diff line number Diff line change 116
116
117
117
if ($PSCmdlet.ParameterSetName -eq " onCluster" ){
118
118
$Script :store = Get-Cluster - Server $Script :vmServer - Name $ClusterName - ErrorAction Stop
119
+ $cmdArgs [' Name' ] = $NameOfVM
119
120
$cmdArgs.Add (' ResourcePool' , $Script :store )
120
121
}
121
122
if ([System.String ]::IsNullOrEmpty($Location ) -eq $false ){
Original file line number Diff line number Diff line change 92
92
else {
93
93
$Script :Cim = New-CimSession - ComputerName $ComputerName - Credential $AccessAccount - ErrorAction Stop
94
94
}
95
- $prn = Get-Printer - CimSession $Script :Cim - Name $PrinterName - ComputerName $ComputerName - ErrorAction SilentlyContinue
95
+ $prn = Get-Printer - CimSession $Script :Cim - Name $PrinterName - ComputerName $ComputerName - ErrorAction SilentlyContinue
96
96
if ($null -eq $prn ){
97
97
$Script :Output += " Printer $ ( $PrinterName ) not found"
98
98
}
109
109
Set-Printer @cmdArgs - Shared - ShareName $ShareName
110
110
}
111
111
if ($PSBoundParameters.ContainsKey (' PrintProcessor' ) -eq $true ){
112
- Set-Printer - PrintProcessor $PrintProcessor
112
+ Set-Printer - PrintProcessor $PrintProcessor
113
113
}
114
114
if ($PSBoundParameters.ContainsKey (' Comment' ) -eq $true ){
115
115
Set-Printer @cmdArgs - Comment $Comment
You can’t perform that action at this time.
0 commit comments