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
[user] | |
name = Zafer Balkan | |
email = zafer@zaferbalkan.com | |
username = zbalkan | |
signingkey = EECD6A2984E3EEE3 | |
[init] | |
defaultbranch = master | |
[core] | |
pager = delta | |
autocrlf = 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
#Requires -Version 3 | |
# In this scenario, it is assumed that each user will have a home folder, including 3 sub-folders as a template. | |
# The tree can be visualized like below: | |
# | |
# Home | |
# |_ user1 | |
# |_ user2 | |
# |_ user3 | |
# |_ user4 |
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
#Requires -Modules GPRegistryPolicyParser | |
#Requires -Version 5 | |
Import-Module -Name GPRegistryPolicyParser -WarningAction Ignore | |
Add-Type -AssemblyName System.Windows.Forms | |
$Script:response = [System.Windows.Forms.MessageBox]::Show("Do you want to open current hives?`n`nClick Yes to display current hives on this computer.`nClick No to pick a `'registry.pol`' file to read.", "Open current hives?", [System.Windows.MessageBoxButton]::YesNoCancel, [System.Windows.MessageBoxImage]::Question) | |
switch ($Script:response) | |
{ |
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
# Configuration variables | |
$PrintServer = "" | |
$CSVFilePath = "printers.csv" | |
$XMLFilePath = "printers.xml" | |
# The code | |
Import-Module ActiveDirectory | |
$Domain = (Get-ADDomain).name |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDh53gwlEcTH9HXjfJ9ojVFn3WhWHVcH52rkGWpn1nq/jXb2+qhiefS10DpRQDCyCCHOvc0vDgKUbD1bP7Qp97NacccOCMNaU8N120tQe/UrN4MM/5RLjYk2rNwUn3HdERIHUWG3DE9Xa2kGadO3/69aaDGNw9sFk+FwkiwUpi5xhV8WjZf6FRZmlkVpPf3g3id+AH1boNFVUdiR6A3rO3EPXTsJq3Ib8I3e3U6do6OkEOLp0Ot1DdDhIrNm3OsahYyGZ6jiFJTOTbSIsiyNqqmIR/B3QK//6tzBVMz9klaQs08nMBLaywbsyvadPQJzdHMR8hk+d8InvQQh711oZaz zafer@HP |
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
#Hosts | |
$Source = "Source ESXi Server IP address/Hostname" | |
$Target = "Target ESXi Server IP address/Hostname" | |
# Creds | |
$root = "root" | |
$rootPassword = "root password" | |
$admin = "administrator@vsphere.local" # Not used here. It will be needed when enumerating all hosts. | |
$adminPassword = "administrator password" # Not used here. It will be needed when enumerating all 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
# Logging | |
$LogCommandHealthEvent = $true | |
$LogCommandLifecycleEvent = $true | |
# Culture | |
Set-Culture -CultureInfo en-us | |
[Console]::InputEncoding = [System.Text.Encoding]::UTF8 | |
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
# Modify Get-History alias, like history command in bash |
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
#Requires -RunAsAdministrator | |
#Requires -Version 5 | |
<# | |
.Synopsis | |
Activates Windows via KMS | |
.DESCRIPTION | |
It's a drop in replacement for slmgr scripts | |
.EXAMPLE | |
Start-WindowsActivation -Verbose # Activates the local computer | |
.EXAMPLE |
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
Add-Type -Assembly System.Windows.Forms | |
$script:MainForm = New-Object System.Windows.Forms.Form | |
$script:MainForm.Text = '' | |
$script:MainForm.Width = 600 | |
$script:MainForm.Height = 400 | |
$script:MainForm.AutoSize = $false | |
$script:MainForm.TopMost = $true | |
$script:MainForm.FormBorderStyle = 'None' | |
$script:MainForm.WindowState = 'Maximized' | |
$script:MainForm.BackColor = 'Black' |
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
<# | |
.Synopsis | |
Sends an email message using existing Exchange Server with user's credential. | |
.DESCRIPTION | |
The Send-MailMessage2 cmdlet sends an email message from within Windows PowerShell. It utilizes Autodiscovery feature of Exchange Server. | |
.EXAMPLE | |
Send an email from one user to another: | |
PS C:\>Send-MailMessage2 -To "User01 <user01@example.com>" -Subject "Test mail" |