Differences between revisions 6 and 8 (spanning 2 versions)
Revision 6 as of 2020-08-16 22:05:15
Size: 1463
Editor: PieterSmit
Comment:
Revision 8 as of 2021-09-02 20:47:21
Size: 2167
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:

= PowerShell view user certificates =
 * {{{
> Get-ChildItem -Path "Cert:\CurrentUser\My"


   PSParentPath: Microsoft.PowerShell.Security\Certificate::CurrentUser\My

Thumbprint Subject
---------- -------
...
}}}

= PowerShell windows update on remote computer =
 * Have to do it through a job {{{
ServerData = "<ServerName>"
invoke-WUJob -ComputerName $ServerData.Value -Script { Import-Module PSWindowsUpdate ; Install-WindowsUpdate -AcceptAll -SendReport -IgnoreReboot -PSWUSettings @{From='xy';Port=25;SmtpServer='xy';To='xy'} | Out-File C:\install\PSWindowsUpdateLog.txt -Append} -Confirm:$false -verbose -RunNow
}}}

Windows/PowerShell Notes

  • Load context

    foreach($server in (get-content 'C:\Downloads\pilot_dev_servers.txt')){Get-ADComputer -Identity $server | select -ExpandProperty DistinguishedName}

Missing powershell commands

PowerShell view user certificates

  • > Get-ChildItem -Path "Cert:\CurrentUser\My"
    
    
       PSParentPath: Microsoft.PowerShell.Security\Certificate::CurrentUser\My
    
    Thumbprint                                Subject
    ----------                                -------
    ...

PowerShell windows update on remote computer

  • Have to do it through a job

    ServerData = "<ServerName>"
    invoke-WUJob -ComputerName $ServerData.Value -Script { Import-Module PSWindowsUpdate ; Install-WindowsUpdate -AcceptAll -SendReport -IgnoreReboot -PSWUSettings @{From='xy';Port=25;SmtpServer='xy';To='xy'} | Out-File C:\install\PSWindowsUpdateLog.txt -Append} -Confirm:$false -verbose -RunNow

Windows/PowerShell (last edited 2022-01-26 21:34:01 by PieterSmit)