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
{ | |
"breadcrumbs.enabled": true, | |
"editor.accessibilitySupport": "off", | |
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace", | |
"editor.fontLigatures": true, | |
"editor.fontSize": 12, | |
"editor.minimap.enabled": false, | |
"editor.tabSize": 2, | |
"editor.lineNumbers": "on", | |
"files.insertFinalNewline": 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
<?xml version="1.0" encoding="utf-8"?> | |
<Apps> | |
<App DisplayName="Computer Manager" FileName="%WINDIR%\system32\compmgmt.msc" Arguments="/Computer=%HostName%" WorkingDir="" WaitForExit="False" TryToIntegrate="False" RunElevated="False" ShowOnToolbar="True" /> | |
<App DisplayName="Explorer - C: " FileName="%WINDIR%\explorer.exe" Arguments="\\%HostName%\c$" WorkingDir="" WaitForExit="False" TryToIntegrate="False" RunElevated="False" ShowOnToolbar="True" /> | |
<App DisplayName="Explorer - E:" FileName="%WINDIR%\explorer.exe" Arguments="\\%HostName%\e$" WorkingDir="" WaitForExit="False" TryToIntegrate="False" RunElevated="False" ShowOnToolbar="True" /> | |
<App DisplayName="Powershell - CredSSP" FileName="%WINDIR%\system32\WindowsPowerShell\v1.0\PowerShell.exe" Arguments="-NoProfile -NoExit -Command "&{ Set-Location -Path C:\Temp\ ; $host.ui.RawUI.WindowTitle= '%Hostname%' ; Enter-PSSession -Authentication CredSSP -ComputerName %Hostname% -EnableNetworkAccess -Credential $(Get-Credential -Message 'Lo |
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
If ( ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
Write-Output "Powershell running with elevated privileges" | |
} else { | |
Write-Output "Powershell running as user, without admin privileges" | |
} |
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
If ( ! (Get-module ActiveDirectory )) { | |
Import-Module ActiveDirectory | |
} | |
# accunts to compare | |
$UserName1 = "Username1" | |
$UserName2 = "Username2" | |
# Getting the AD User objects, inkluding the MemberOf property | |
$userAccount1 = Get-ADUser -Identity $UserName1 -Properties MemberOf |
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
-- MS SQL Server: sp_who2 to temp table | |
CREATE TABLE #temp_sp_who2 ( | |
SPID INT,Status VARCHAR(255), | |
Login VARCHAR(255), | |
HostName VARCHAR(255), | |
BlkBy VARCHAR(255), | |
DBName VARCHAR(255), | |
Command VARCHAR(255), | |
CPUTime INT, | |
DiskIO INT, |
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 physical RAM in Gb | |
$physicalRAM = "{0:N0}" -f ((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory / 1gb) |
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
configure | |
set interfaces ethernet eth0 address '10.20.25.2/24' | |
set interfaces ethernet eth0 description 'Outside' | |
set interfaces ethernet eth0 duplex 'auto' | |
set interfaces ethernet eth0 speed 'auto' | |
set interfaces ethernet eth1 address '192.168.1.1/24' | |
set interfaces ethernet eth1 description 'Inside' | |
set interfaces ethernet eth1 duplex 'auto' | |
set interfaces ethernet eth1 speed 'auto' |
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
# Set all AD user-account passwords to never expire. | |
# Use in test/dev-environments only! :-) | |
Get-ADUser -Filter * | Set-ADUser -PasswordNeverExpires:$true -Verbose |
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
# Remove the "modern app" version of Skype. Tested on Win 10 preview. | |
Get-AppxPackage -Name Microsoft.SkypeApp | Remove-AppxPackage |
NewerOlder