This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# search system for KB3125574 and remove\reboot it if it exists | |
$lesigh = Get-WmiObject -Class Win32_QuickFixEngineering | ?{$_.hotfixid -eq 'KB3125574'} | |
if ($lesigh) | |
{ | |
$rmString = "cmd.exe /c wusa.exe /uninstall /KB:3125574 /quiet /norestart" | |
([WMICLASS]"\\$env:computername\ROOT\CIMV2:win32_process").Create($rmString) | out-null | |
sleep -Seconds 600 | |
Restart-Computer -Force | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On Error Resume Next | |
strComputer = "." | |
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") | |
Set colItems = objWMIService.ExecQuery("Select * from Win32_QuickFixEngineering",,48) | |
For Each objItem in colItems | |
If objItem.HotfixID = "KB3125574" then | |
Wscript.Echo "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = 'https://download.microsoft.com/download/2/C/6/2C6E1B4A-EBE5-48A6-B225-2D2058A9CEFB/Win8.1AndW2K12R2-KB3134758-x64.msu' | |
$file = Split-Path $url -Leaf | |
$path = "C:\Windows\Temp\$file" | |
$wc = New-Object System.Net.WebClient | |
$wc.DownloadFile($url,$path) | |
Invoke-Expression -Command "wusa.exe $path /quiet /norestart" | |
sleep -seconds 180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-Cluster -Domain mydomain.com | %{Get-ADComputer -properties passwordlastset $_.name | ?{$_.enabled -eq $true} | select Name, PasswordLastSet, Enabled, @{Name="Nodes";Expression={(Get-ClusterNode -Cluster $_.name) -join ', '}}, @{Name="ClusterIP";Expression={(Resolve-DnsName $_.name).ipaddress}}} | ft -a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function New-VMDeploy { | |
[CmdletBinding()] | |
Param() | |
DynamicParam { | |
# Set the dynamic parameters' name | |
$ParamName_portgroup = 'PortGroup' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-WmiObject Win32_logicaldisk -ComputerName LocalHost | Format-Table DeviceID, MediaType, @{Name="Size(GB)";Expression={[decimal]("{0:N0}" -f($_.size/1gb))}}, @{Name="Free Space(GB)";Expression={[decimal]("{0:N0}" -f($_.freespace/1gb))}}, @{Name="Free (%)";Expression={"{0,6:P0}" -f(($_.freespace/1gb) / ($_.size/1gb))}} -AutoSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diskpart | |
select disk 1 | |
attributes disk clear readonly | |
online disk | |
select disk 1 | |
clean | |
convert gpt | |
create partition primary | |
format quick fs=ntfs label="data" unit=64k | |
assign letter=“E" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function InitializeWindowsCredential | |
{ | |
Write-Verbose ("Loading PasswordVault Class.") | |
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime] | |
} | |
InitializeWindowsCredential | |
function ConvertTo-PasswordCredential | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Usage 'webscript.bat SomeScriptName' | |
echo off | |
set script=%1 | |
shift | |
set scriptname=%script%.ps1 | |
powershell -command "iwr https://artifactory..com/artifactory/scripts/vmwarerunonce/%scriptname% -UseBasicParsing | iex" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ClusterDatastoreClusters | |
{ | |
param | |
( | |
[CmdletBinding()] | |
[Parameter(Mandatory)] | |
[string]$Cluster | |
) | |
begin |
OlderNewer