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
# Replace variables with desired values | |
Get-OSCustomizationSpec -Name $OSSpec | ` | |
Get-OSCustomizationNicMapping | ` | |
Set-OSCustomizationNicMapping -IpMode:UseStaticIP -IpAddress $IP -SubnetMask $Mask -DefaultGateway $Gateway | |
Get-VM -Name $VMName| Set-VM -OSCustomizationSpec $OSSpec |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\IRST] | |
"Display"="(UTC+03:30) IRST" | |
"Dlt"="Iran Daylight Time" | |
"MUI_Display"="IRST" | |
"MUI_Dlt"="IRST" | |
"MUI_Std"="IRST" | |
"Std"="IRST" | |
"TZI"=hex:2e,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ |
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
$tzi = [byte[]]@(0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00) | |
$bias = [System.BitConverter]::ToInt32($tzi, 0) | |
$standardBias = [System.BitConverter]::ToInt32($tzi, 4) | |
$daylightBias = [System.BitConverter]::ToInt32($tzi, 8) | |
$standardStart = [System.DateTime]::FromFileTime([System.BitConverter]::ToInt64($tzi, 12)) | |
$daylightStart = [System.DateTime]::FromFileTime([System.BitConverter]::ToInt64($tzi, 20)) | |
Write-Host "Standard bias from UTC: $bias minutes" | |
Write-Host "Standard offset from UTC: $standardBias minutes" | |
Write-Host "Daylight bias from UTC: $daylightBias minutes" |
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
$SQLServer = 'localhost' | |
$SQLDBName = 'VDIEvents' | |
$SQLQuery = "select [EventID], | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE([EventType],'AGENT_',''),'ENDED','DISCONNECT'),'RECONNECTED','CONNECT'),'DISCONNECTED','DISCONNECT'),'CONNECTED','CONNECT') as 'Type', | |
[Time], | |
REPLACE(REPLACE (REPLACE([UserDisplayName],'domain.org',''),'\',''),'DOMAIN','') as UserName, | |
[DesktopDisplayName] | |
from dbo.user_events_hist | |
where DATEDIFF(Day,Time,GETDATE()) = 1 and SessionType = 'DESKTOP' | |
order by [UserName],[Time]" |
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
#!/bin/bash | |
# The script will be worked on RHEL/Fedora/CentOS. | |
# Set logging options | |
# Variables. | |
primary_ip_check="192.168.1.254" | |
replica_ip_check="192.168.2.254" | |
primary_net="192.168.1" | |
replica_net="192.168.2" | |
keep_alive_file="/etc/keepalived/keepalived.conf" | |
hosts_file="/etc/hosts" |
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
$Servers= "iLO IP1","iLO IP2" | |
$Credential=Get-Credential | |
ForEach ($Server in $Servers) | |
{ | |
$BIOSConnection= Connect-HPEBIOS -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
$iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
Start-Sleep -s 30 | |
#Restore Defaults | |
Reset-HPEBIOSUserDefault -Connection $BIOSConnection -RestoreDefault | |
Start-Sleep -s 30 |
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
$Servers= "iLO IP1","iLO IP2" | |
$Credential=Get-Credential | |
ForEach ($Server in $Servers) | |
{ | |
$SAConnection= Connect-HPESA -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
$iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication | |
Start-Sleep -s 60 | |
$HostPower= Get-HPEiLoServerPower -Connection $iLOConnection | |
If ($HostPower.Power -eq "Off") | |
{ |
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
ver | findstr /i "6\.1\." > nul | |
IF %ERRORLEVEL% EQU 0 goto Win7 | |
FOR /D %%X IN ("C:\Documents and Settings\temptask*") DO RD /S /Q "%%X" | |
net user /add TempTask 1234!@#$qwer | |
net localgroup administrators TempTask /add | |
Copy \\SharedFolder\Auto_Clean.vbs C:\Windows /Y | |
schtasks /create /S %computername% /RU %computername%\TempTask /RP 1234!@#$qwer /TN "TempTask" /TR C:\Windows\Auto_Clean.vbs /SC Daily /ST 05:00 /f | |
schtasks /run /TN TempTask | |
timeout /t 30 | |
schtasks /delete /TN TempTask /F |
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
force_cscript | |
dim objWSH, sProfile, objFolder | |
dim objFSO, sProfileRoot, objProfileFolder | |
dim sTemp, sWindows | |
set objFSO=CreateObject("Scripting.FileSystemObject") | |
' Get user profile root folder | |
set objWSH = CreateObject("WScript.Shell") |
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
'Version 1.0 | |
'Written by Davoud Teimouri | |
Option Explicit | |
On Error Resume Next | |
Dim strComputer | |
Dim strUser | |
Dim objGroup | |
Dim ObjUser | |
strComputer = Inputbox ("Please enter the computer name (Without domain name):") | |
strUser= Inputbox ("Please enter the user name:") |
NewerOlder