NIC error modern UI – Windows cannot access specified device, path, or file. You may not have the appropriate permissions to access the item. Solution: In an elevated command prompt, run gpedit.msc Go to Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options Open “User Account Control: Admin Approval Mode…
Get Network card driver version remotely
1 2 3 4 5 6 7 8 9 10 11 12 |
# Get Network card driver version remotely and only for a specific vendor $cred = Get-Credential domain\user Invoke-Command -Credential $cred -ScriptBlock {Get-WmiObject Win32_PnPSignedDriver -Filter "DeviceClass = 'NET'" | Where-Object devicename -Match qlogic | ft DeviceName,DriverVersion} -ComputerName computernamehere #sample output: #DeviceName DriverVersion #---------- ------------- #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 #QLogic FastLinQ QL45412H 40GbE Adapter (VBD Client) 8.37.6.0 |
Get Dell ambient temperature in powershell
1 2 |
# Ambient temperature for Dell servers with Server Administrator installed $a = get-wmiobject cim_temperaturesensor -namespace root\cimv2\dell; $a.Name + ': ' + ("{0:##}" -f $a.CurrentReading).Substring(0, 2) + ',' + ("{0:##}" -f $a.CurrentReading).Substring(2,1) |
Enable remote desktop using Powershell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# #Enable remote desktop (Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices).SetAllowTsConnections(1) (Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(1) #Enable PSRemoting Enable-PSRemoting -Force Winrm quickconfig #Set firewall rules Set-NetFirewallRule -DisplayName "Remote Desktop*" -enabled true # |
Simple patch script
Recently i needed a quick way to automate patching and rebooting of servers in our data-center. We felt that just using standard WSUS with GPOs was to fuzzy and not specific enough regarding reporting after patching had completed. I could have set up our event log collection servers to alert any errors post-reboot, or i…