Category: Uncategorized

Fix WMI Service Not Starting/SCCM Client failing to install due to WMI errors

I used this fix when the SCCM client wouldn’t install on a Windows 7 client, it was failing to start the Windows Magagement Instrumentation service. 1. Log onto Windows 7 with an administrator account, click Start, type services.msc in the Start Search box and press Enter. 2. In the right pane of the Service console, locate and right-click Windows Management Instrumentation,…

Powershell behind a proxy

Open powershell as admin notepad $PROFILE copy in: $browser = New-Object System.Net.WebClient $browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials Save, close and restart powershell

Powershell Pop Up File Selector

Function Get-FileName($initialDirectory) { [System.Reflection.Assembly]::LoadWithPartialName(“”) | Out-Null $OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog $OpenFileDialog.initialDirectory = $initialDirectory $OpenFileDialog.filter = “All files (*.*)| *.*” $OpenFileDialog.ShowDialog() | Out-Null $OpenFileDialog.filename } #end function Get-FileName # *** Entry Point to Script *** $thefile = Get-FileName -initialDirectory “c:fso” Write-host $thefile

Create shortcuts with Powershell

$TargetFile = “<path to exe>” $ShortcutFile = “$env:Public\Desktop\<name of shortcut>.lnk” #replace url with location it should be placed $WScriptShell = New-Object -ComObject WScript.Shell $Shortcut = $WScriptShell.CreateShortcut($ShortcutFile) $Shortcut.TargetPath = $TargetFile $Shortcut.Save()