full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Snippets/PSCreds.ps1
PSCreds.ps1
$localCred = new-object -typename System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force)
PowerShellCorpus/Github/samelamin_EventStorming/PublishScripts/Publish-WebApplicationVM.ps1
Publish-WebApplicationVM.ps1
#Requires -Version 3.0 <# .SYNOPSIS Creates and deploys a Microsoft Azure Virtual Machine for a Visual Studio web project. For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394472 .EXAMPLE PS C:\> .\Publish-WebApplicationVM.ps1 ` -Configuration .\Configurations\WebApplication1-VM...
PowerShellCorpus/Github/chreestopher_Powershell_Migrate_User/Powershell_USER_MIGRATION-RESTORE.ps1
Powershell_USER_MIGRATION-RESTORE.ps1
$PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Definition # Define User to be migrated, temp storage destination, Users profile location $usr = $env:USERNAME $location = read-host " Press U for USB" `n "Press N for Network" `n "Then press ENTER" if ($location -like "U") { $src = "$PSScri...
PowerShellCorpus/Github/chreestopher_Powershell_Migrate_User/Powershell_USER_MIGRATION-BACKUP.ps1
Powershell_USER_MIGRATION-BACKUP.ps1
$PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Definition #Define User to be migrated $usr = $env:USERNAME #Choose migration destination $location = read-host " Press U for USB" `n "Press N for Network" `n "Then press ENTER" if ($location -like "U") { $d...
PowerShellCorpus/Github/marchundley_WIM-Driver-injection/Driver Injection.ps1
Driver Injection.ps1
#Make sure we are clean on screen cls # Prevent errors from displaying on screen $ErrorActionPreference = "SilentlyContinue" $WarningPreference = "SilentlyContinue" #Set Initial directory for file selection prompt $InitialDirectory = "C:\" # Show an Open File Dialog and return the file selected by the use...
PowerShellCorpus/Github/kimizhu_testmsdn/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/Graham-Beer_GetPingStatus/Get-PingStatus.ps1
Get-PingStatus.ps1
Function Get-PingStatus { param( [Parameter(ValueFromPipeline=$true)] [string]$device, [validateSet("Online","Offline","ObjectTable")] [String]$getObject ) begin{ $hash = @() } process{ $device| foreach { if (Test-...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1486875947530/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/zaicnupagadi_PermissionMatrixGraphBuilder.ps1/PermissionMatrixGraphBuilder.ps1
PermissionMatrixGraphBuilder.ps1
<# .SYNOPSIS PermissionMatrixGraphBuilder.ps1 - easy script that generates graph from provided CSV file. .DESCRIPTION Easy script that generates graph from provided CSV file. .OUTPUTS Output set in the script is a png file, however that can be changed by modifying -T parameter for dot.exe .PARAMETER Users...
PowerShellCorpus/Github/artofshell_course-arm/Azure Resource Manager (ARM) Resource Providers.ps1
Azure Resource Manager (ARM) Resource Providers.ps1
<######################################################### Author: Trevor Sullivan <trevor@artofshell.com> Description: This PowerShell script demonstrates how to deploy a Microsoft Azure Resource Manager (ARM) JSON template using Windows PowerShell. COPYRIGHT NOTICE This file is part of the "Microso...
PowerShellCorpus/Github/artofshell_course-arm/Azure Resource Manager (ARM) Policy.ps1
Azure Resource Manager (ARM) Policy.ps1
<######################################################### Author: Trevor Sullivan <trevor@artofshell.com> Description: This PowerShell script demonstrates how to create a custom Azure Resource Manager (ARM) Policy, apply it to a Resource Group, and demonstrate how the policy prevents unauthorized act...
PowerShellCorpus/Github/artofshell_course-arm/Azure Resource Manager (ARM) Locks.ps1
Azure Resource Manager (ARM) Locks.ps1
<######################################################### Author: Trevor Sullivan <trevor@artofshell.com> Description: This PowerShell script demonstrates how to create a custom Azure Resource Manager (ARM) Policy, apply it to a Resource Group, and demonstrate how the policy prevents unauthorized act...
PowerShellCorpus/Github/artofshell_course-arm/Azure Resource Manager (ARM) RBAC.ps1
Azure Resource Manager (ARM) RBAC.ps1
<######################################################### Author: Trevor Sullivan <trevor@artofshell.com> Description: This PowerShell script demonstrates how to create a custom Azure Resource Manager (ARM) Policy, apply it to a Resource Group, and demonstrate how the policy prevents unauthorized act...
PowerShellCorpus/Github/TianXingjian0329_SA44TEAM08b-SFBS/SA44TEAM08b-SFBS/packages/EntityFramework.6.1.3/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/TianXingjian0329_SA44TEAM08b-SFBS/SA44TEAM08b-SFBS/packages/EntityFramework.6.1.3/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/JDK7/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
$script_path = $(Split-Path -parent $MyInvocation.MyCommand.Definition) $common = $(Join-Path $script_path "common.ps1") . $common # Function to remove a value from the Machine Environment Variable path value function Uninstall-ChocolateyPath { param( [string] $pathToUninstall, [System.EnvironmentVariableT...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/JDK7/tools/common.ps1
common.ps1
$package = 'jdk7' $build = '15' $jdk_version = '7u79' $java_version = "1.7.0_79" $uninstall_id = "17079" $checksumX64 = '80B1452C808691DC63945926C52156C8AFE7EBCFA3747093FD296F0A3F1CFBCC' $checksumX32 = '658643EF2775E015449409B844AF4FDB087F51921B61E5DD02DAC62A43C956F2' $checksumType = 'sha256' # Check if OS...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/JDK7/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$script_path = $(Split-Path -parent $MyInvocation.MyCommand.Definition) $common = $(Join-Path $script_path "common.ps1") . $common # $params = "$env:chocolateyPackageParameters" # -params '"x64=false;path=c:\\java\\jdk"' # $params = (ConvertFrom-StringData $params.Replace(";", "`n")) if (checkIfInstal...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/automatic/AndroidStudio/tools/common.ps1
common.ps1
$package = '{{PackageName}}' #$majorVersion = '2.1.1.0' #$buildVersion = '143.2821654' #$checksum = 'd8cb3968814b6155f4effe727baf23b18b9f8360' $extractionPath = Join-Path $env:programfiles 'Android' $installDir = Join-Path $extractionPath 'Android Studio' function use64bit() { return Get-ProcessorBits 64; ...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/automatic/AndroidStudio/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
# Common Functions and Config . (Join-Path $(Split-Path -parent $MyInvocation.MyCommand.Definition) 'Common.ps1') if (Test-Path ($installDir)) { $uninstallExe = GetUninstallFile $params = @{ PackageName = $package; FileType = "exe"; SilentArgs = "/S"; File = $un...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/automatic/AndroidStudio/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
# Common Functions and Config . (Join-Path $(Split-Path -parent $MyInvocation.MyCommand.Definition) 'Common.ps1') #$studioExe = (gci "${installdir}/bin/studio64.exe").FullName | sort -Descending | Select -first 1 $studioExe = GetStudioExe # Remove Pinned Item if it exist Uninstall-ChocolateyPinnedTaskBarItem $...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/automatic/android-sdk/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$downUrl = 'https://dl.google.com/android/installer_r24.4.1-windows.exe' $checksum = '260132A1903CAC17276FE2A6B7D710E96B69EC1D79DE8BE21AD828C58B45B804' $checksumType = 'sha256' Install-ChocolateyPackage 'android-sdk' 'exe' '/S' $downUrl -validExitCodes @(0) -Checksum "$checksum" -ChecksumType "$checksumType" I...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/automatic/android-sdk/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
# Function to remove a value from the Machine Environment Variable path value function Uninstall-ChocolateyPath { param( [string] $pathToUninstall, [System.EnvironmentVariableTarget] $pathType = [System.EnvironmentVariableTarget]::User ) Write-Debug "Running 'Uninstall-ChocolateyPath' with pathToUninsta...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/AndroidStudio/tools/common.ps1
common.ps1
$package = 'AndroidStudio' $majorVersion = '2.3.1.0' $buildVersion = '162.3871768' $checksum = '95ca44467d399e609e86bf874eba00f8f2e6e371ae294b7f1e88cfc8689e14dd' $extractionPath = Join-Path $env:programfiles 'Android' $installDir = Join-Path $extractionPath 'Android Studio' function use64bit() { return Get-...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/AndroidStudio/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
# Common Functions and Config . (Join-Path $(Split-Path -parent $MyInvocation.MyCommand.Definition) 'Common.ps1') if (Test-Path ($installDir)) { $uninstallExe = GetUninstallFile $params = @{ PackageName = $package; FileType = "exe"; SilentArgs = "/S"; File = $un...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/AndroidStudio/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
# Common Functions and Config . (Join-Path $(Split-Path -parent $MyInvocation.MyCommand.Definition) 'Common.ps1') #$studioExe = (gci "${installdir}/bin/studio64.exe").FullName | sort -Descending | Select -first 1 $studioExe = GetStudioExe # Remove Pinned Item if it exist Uninstall-ChocolateyPinnedTaskBarItem $...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/android-sdk/tools/common.ps1
common.ps1
$packageName = 'android-sdk' $downUrl = 'https://dl.google.com/android/repository/tools_r25.2.3-windows.zip' $checksum = '23d5686ffe489e5a1af95253b153ce9d6f933e5dbabe14c494631234697a0e08' $checksumType = 'sha256' $androidPath = "${Env:SystemDrive}\Android" $destination = "${androidPath}\android-sdk" $fileNa...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/android-sdk/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
. (Join-Path $(Split-Path -parent $MyInvocation.MyCommand.Definition) 'Common.ps1') Install-ChocolateyZipPackage -PackageName $packageName -url $downUrl -unzipLocation $destination -ChecksumType "$checksumType" -Checksum "$checksum" Install-ChocolateyPath $envToolsPath 'Machine' Install-ChocolateyPath $envPlat...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/android-sdk/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
. (Join-Path $(Split-Path -parent $MyInvocation.MyCommand.Definition) 'Common.ps1') if (Test-Path ($destination)) { adb kill-server Uninstall-ChocolateyZipPackage $packageName $fileName Uninstall-ChocolateyPath $envToolsPath 'Machine' Uninstall-ChocolateyPath $envPlatformsPath 'Machine' Uninstal...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/SourceCodePro/tools/FontHelpers.ps1
FontHelpers.ps1
######################################################################################### # MICROSOFT LEGAL STATEMENT FOR SAMPLE SCRIPTS/CODE ######################################################################################### # This Sample Code is provided for the purpose of illustration only and is not #...
PowerShellCorpus/Github/digitaldrummerj_ChocolateyPackages/SourceCodePro/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
function Get-CurrentDirectory { $thisName = $MyInvocation.MyCommand.Name [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) } $fontHelpersPath = (Join-Path (Get-CurrentDirectory) 'FontHelpers.ps1') . $fontHelpersPath $fontUrl = 'https://github.com/adobe-fonts/source-code-pro/archive/2.030...
PowerShellCorpus/Github/tsfahmed2_Cleanwipe-Runner/cleanwiperunner.ps1
cleanwiperunner.ps1
$PSScriptRoot = ($MyInvocation.MyCommand.Path | Split-Path | Resolve-Path).ProviderPath $BuildName = $PSScriptRoot | Split-Path -Leaf #Start-Process -FilePath msiexec.exe -ArgumentList $arguments -Wait -PassThru $process = Start-Process -filepath $PSScriptRoot\CleanWipe.exe add-type -AssemblyName microsoft.Visu...
PowerShellCorpus/Github/ealexjordan_ShellScripts/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
#PowerShell Profile #Windows #9-13-2016 #Alex Jordan ############### Custom PowerShell Colors ################# $Host.UI.RawUI.BackgroundColor = ($bckgrnd = 'black') $Host.UI.RawUI.ForegroundColor = 'green' $Host.PrivateData.ErrorForegroundColor = 'red' $Host.PrivateData.ErrorBackgroundColor = $bckgrnd $...
PowerShellCorpus/Github/vjacksonr123_powershell/Script to create local users/createlocaluser.ps1
createlocaluser.ps1
[CmdletBinding()] Param( [string[]]$ComputerName = $env:COMPUTERNAME, [Parameter(Mandatory=$true)] [ValidateSet("Group","User")] [string]$ObjectType, [Parameter(Mandatory=$true)] [string]$ObjectName ) if($ObjectType -eq "User") { $PasswordForUser = Read-Host -Prompt "Enter a ...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/set-user-passowrd-no-expire.ps1
set-user-passowrd-no-expire.ps1
'$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session ' Connect-MsolService $usergranted = read-host "Pl...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/disable-clutter-singleuserl-mailboxe.ps1
disable-clutter-singleuserl-mailboxe.ps1
$usergranted = read-host "Please enter mailbox user (with FQDN)" Set-Clutter -Identity admin@businessprinting.com -Enable $false
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/remove-full-mailbox-access.ps1
remove-full-mailbox-access.ps1
$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session $userarchive = read-host "Please enter mailbox identiy ...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/connect-office-365.ps1
connect-office-365.ps1
Set-ExecutionPolicy RemoteSigned Set-ExecutionPolicy Unrestricted $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSS...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/Get-DistributionGroupMembers.ps1
Get-DistributionGroupMembers.ps1
################################################################################################################################################################ # Script accepts 2 parameters from the command line # # Office365Username - Optional - Administrator login ID for the tenant we are querying # Office36...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/import-dl-lists.ps1
import-dl-lists.ps1
#### Set Variable Set-Variable -name DGOwners -value timmckenna@absbiomedical.com #### Create Function Logon to Office365 - Exchange Online function Logon { #### Pop-up a dialog for username and request your password $cred = Get-Credential #### Import the Local Microsoft Online PowerShell Module Cm...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/connect-office-365-powershell.ps1
connect-office-365-powershell.ps1
$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/disconnect-office-365-powershell.ps1
disconnect-office-365-powershell.ps1
Remove-PSSession $Session
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/connect-office-365-MS-Online-svc.ps1
connect-office-365-MS-Online-svc.ps1
Connect-MsolService
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/get-user-list-export-excel.ps1
get-user-list-export-excel.ps1
#Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” } #Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” } | Select-Object UserPrincipalName, DisplayName, Country, Department | Export-Csv c:\LicensedUsers.csv #Get-MsolUser | Where-Object { $_.isLicensed -eq “TRUE” } | Select-Object UserPrincipalName,...
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/disable-clutter-all-mailboxes.ps1
disable-clutter-all-mailboxes.ps1
Get-Mailbox | Set-Clutter -Enable $false
PowerShellCorpus/Github/vjacksonr123_powershell/Office 365 Scripts/grant-user-full-mb-access.ps1
grant-user-full-mb-access.ps1
$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session $userarchive = read-host "Please enter mailbox identiy ...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/CheckService.ps1
CheckService.ps1
# Windows Powershell script to show the status of IIS6+ (HTTP only, doesn't include FTP or SSL) # The script has been written using PowerShell functions to make the whole thing shorter # # Checks for the IIS Admin, World Wide Web Publishing Service, FTP Publishing Service, NNTP and SMTP services # # Chris Rasmusse...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/register-vm.ps1
register-vm.ps1
Connect-VIServer -Server "ntvw4vcp01.conseco.ad" $folder = Get-View (Get-Datacenter -Name "Conseco View 4.5" | Get-Folder -Name "vm").ID $pool = Get-View (Get-Cluster -Name "Theta" | Get-ResourcePool -Name "Resources").ID $guestname = [regex]"^([\w]+).vmx" $esxImpl = Get-VMHost -Name esxtheta01.conseco.com $...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.DeployCSV.ps1
VM.DeployCSV.ps1
Connect-VIServer view4vc.conseco.ad $vmcsv = Import-Csv \\ntadminp01\Public\VMware\VMDesktops.csv ### Imports VM deployment specs $sourcevm = "W7-SP1-X86" ### Sets source vm\template $rspool = Get-VMHost 'esxtheta01.conseco.com' | Get-ResourcePool '6. Desktops' #Shutdown-VMGuest $sourcevm -Confirm:$fa...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Cluster.DisableHADRS.ps1
Cluster.DisableHADRS.ps1
Connect-VIServer vcenter.conseco.ad Get-Cluster | Set-Cluster -HAEnabled:$false -DrsEnabled:$false -Confirm:$false Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Set-MultiPathPolicy.ps1
Set-MultiPathPolicy.ps1
Connect-VIServer vcenter.conseco.ad # get-cluster -name "Sigma" | get-vmhost | get-scsilun | set-scsilun -MultiPathPolicy RoundRobin get-cluster -name "Sigma" | get-vmhost | get-scsilun | Export-Csv C:\MPP.csv Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.ResourceAdd.ps1
VM.ResourceAdd.ps1
function load-VITK(){ & { $ErrorActionPreference = "silentlycontinue" $vmwareSnapin = Add-PSSnapin "VMware.VimAutomation.Core" -ErrorVariable myErr switch -regex ($myErr[0].Exception.ErrorRecord) { "VMware.VimAutomation.Core is not installed" { "VMware.VimAutomation.Core is not installed" | W...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VI Search.ps1
VI Search.ps1
Connect-VIServer -Server "vcenter.conseco.ad" Get-VM | Where-Object { $_.powerstate -eq 'PoweredOn' }| Where-Object { $_.name -notlike 'XP*'} | Select Name,
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/DiskInfoSorta.ps1
DiskInfoSorta.ps1
# PowerShell cmdlet to display Logical Disk information $Disk = get-wmiobject -query "select * from Win32_LogicalDisk" -ComputerName NTLPS5DAT1 $DiskToPart = get-wmiobject -query "select * from Win32_LogicalDiskToPartition" -ComputerName NTLPS5DAT1 $DriveToPart = get-wmiobject -query "select * from Win32_DiskDr...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/ArgCheck.ps1
ArgCheck.ps1
ForEach($ArgThing in $Args) { Write-Host $ArgThing }
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.Nframe.Move-vm.ps1
VM.Nframe.Move-vm.ps1
Connect-VIServer vcenter.conseco.ad $vmcsv = Import-Csv "\\ntadminp01\Public\Nframe-Move.csv" Foreach ($line in $vmcsv) { Get-VM -Name $line.Name | Move-VM -Datastore (Get-Datastore $line.Datastore) } Disconnect-VIServer vcenter.conseco.ad
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.DeployXPCSV.ps1
VM.DeployXPCSV.ps1
Connect-VIServer view4vc.conseco.ad $vmcsv = Import-Csv \\ntadminp01\Public\VMware\VMDesktopsXP.csv ### Imports VM deployment specs $sourcevm = "WXP-SP3-X86" ### Sets source vm\template ###$rspool = Get-VMHost 'esxalpha01.conseco.com' | Get-ResourcePool '5. Sandbox' ###Shutdown-VMGues...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.Update-Tools.NoReboot.ps1
VM.Update-Tools.NoReboot.ps1
Connect-VIServer view4vc.conseco.ad Write-Host "WARNING: Automatic update of VMware tools is not fully supported for non-Windows OSs. Manual intervention might be required." ForEach ($Line in Get-Content "H:\VMware\view4vc-update-tools.txt") { Get-VM -Name $Line | Update-Tools -NoReboot } Get-con #Get-VIServe...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/DeployVMgui.ps1
DeployVMgui.ps1
#region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> # <ScriptPackager> # <process>powershell.exe</process> # <arguments /> # <extractdir>%TEMP%</extractdir> # <files /> # <usedefaulticon>true</usedefaulticon> # <showinsystray>false</showinsystray> # <al...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/DeployVM.ps1
DeployVM.ps1
#region VMInfo $OS = "WXP" # W2K3 or WXP $vmname = "XPUSER05" $vmIPaddress = "192.168.202.241" $vmIPgateway = "192.168.202.1" $vmBOIPaddress = "10.141.0.217" $vmnetwork = "VLAN_202" $vmvcpus = 1 $vmram = 1024 #endregion VMInfo #region VMLocation -- For Servers $vmfolder = "Standard Desktop" $vmcl...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/CheckTaskStatus.ps1
CheckTaskStatus.ps1
While($true) { $SmtpClient = new-object system.net.mail.smtpClient $SmtpClient.host = "smtp.conseco.com" $From = "VMware VI <vmwarevi@conseco.com>" $To = "Jakub Pawlak <jakub_pawlak@conseco.com>, <3173547691@txt.att.net>" Connect-VIServer -Server "vcenter.conseco.ad" $TaskStatus = Get-Task -Status "running" | ...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.DesktopLicenseCounts.ps1
VM.DesktopLicenseCounts.ps1
add-pssnapin VMware.VimAutomation.Core Set-PowerCLIConfiguration -DefaultVIServerMode multiple -Confirm:$false Connect-VIServer @('vcenter.conseco.ad','view4vc.conseco.ad') $vmxp = (Get-VM | where {$_.Guest.OSFullName -like '*XP*'}).Count $vmw7 = (Get-VM | where {$_.Guest.OSFullName -like '*7*'}).Count Disconne...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/AD.LockoutCheckNotify.ps1
AD.LockoutCheckNotify.ps1
$Host.UI.RawUI.WindowTitle = "AD Account Lockout Check" do { $Now = Get-Date $LockedOut = Get-QADObject -SearchRoot "dc=conseco,dc=ad" -ldapfilter '(&(&(&(objectCategory=Person)(objectClass=User)(lockoutTime>=1))))' -IncludedProperties sAMAccountName -SizeLimit 0 if($LockedOut.Count -gt 30) { Write-Output "***...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/EmailProcessing.ps1
EmailProcessing.ps1
Add-PSSnapin "VMware.VimAutomation.Core" -ErrorVariable myErr $info = new-object -com outlook.application $objNamespace = $info.GetNameSpace("MAPI") $fld = $objNamespace.GetDefaultFolder(6) $deleted = $objNamespace.GetDefaultFolder(3) #$colItems = $fld.Items | where {$_.SenderEmailAddress -eq "/O=CONSECO/OU=CA...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Get-ServiceAccounts.ps1
Get-ServiceAccounts.ps1
#start #requires -pssnapin PSCX #Author: Glenn Sizemore glnsize@get-admin.com #Purpose: Scan a remote system for any services running under a non standard account. # Standard accounts would be considered, NT AUTHORITY\NetworkService, # NT AUTHORITY\LocalService, LocalSystem, or .\AS...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.AddPortGroupsToCluster.ps1
VM.AddPortGroupsToCluster.ps1
Connect-VIServer vcenter.conseco.ad get-cluster -name 'Delta' | get-vmhost | Get-VirtualSwitch -Name vSwitch0 | New-VirtualPortGroup -Name 'Heartbeat' -VLANID 750 #get-cluster -name 'Delta' | get-vmhost | Get-VirtualSwitch -Name vSwitch0 | New-VirtualPortGroup -Name 'iSCSI' -VLANID 600 #get-cluster -name 'Delta' |...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Set-VMResource.Limit.ps1
Set-VMResource.Limit.ps1
Connect-VIServer view4vc.conseco.ad Get-VM | Get-VMResourceConfiguration | where {$_.MemLimitMB -ne '-1'} | Set-VMResourceConfiguration -MemLimitMB $null Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/CheckNetAppDiskSpace.ps1
CheckNetAppDiskSpace.ps1
$table = New-Object system.Data.DataTable "FileShares" $col01 = New-Object system.Data.DataColumn NetApp,([string]) $col02 = New-Object system.Data.DataColumn Share,([string]) $col03 = New-Object system.Data.DataColumn AvailableSpace,([string]) $col04 = New-Object system.Data.DataColumn TotalSize,([string]) $col05...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/out-sql.ps1
out-sql.ps1
############################################################################## ## ## out-sql.ps1 ## ## by Alexey Yeltsov, Microsoft Corp. ## ## Export pipeline contents into a new SQL table ## ## Parameters: ## $SqlServer - SQL Server ## $Database - Database name ## ...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Get-DiskUsage.ps1
Get-DiskUsage.ps1
# Get-DiskUsage.ps1 (aliased to dfspace) # Use Get-WMIObject to collect disk free info # Can be used with remote systems # param ( [string]$computer = "." , [switch]$all) # Formatting $size = @{ l = "Size (MB)"; e = { $_.size/1mb}; f = "{0:N}"} $free = @{ l = "free (MB)"; e = { $_.freespace/1mb}; f = "{0:N...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/vmhost.rts.ps1
vmhost.rts.ps1
Connect-VIServer vcenter.conseco.ad function StopServiceSSH { $VMHosts = Get-VMHost foreach ($VMHost in $VMHosts) { Get-VMHostService -VMHost $VMHost | where {$_.Key -eq "TSM-SSH"} | Stop-VMHostService -Confirm:$false } } StopServiceSSH Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/LocalUserChecks.ps1
LocalUserChecks.ps1
# # $LocalGroups = "Administrators", "Power Users", "Remote Desktop Users" $Results = @() $Results2 = @() $Results3 = @() $FinalResults = @() $MemberNames = @() # uncomment this line to grab list of computers from a file #$Servers = Get-Content \\ntadminp01\NTADMIN\listofservers.txt $Servers = 'NTTRECSA','N...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/DeployVMdr.old.ps1
DeployVMdr.old.ps1
#deploy [vmname] [osver] [foip] [fogw] [boip] [vcpus] [rammb] [ddrvgb] [vmhost] [vmdatastore] #region VMInfo $vmfolder = "DR" $vmcluster = "phi" $vmresourcepool = "1. PROD" $viserver = "172.31.9.100" $OS = "SRV" # SRV or DESK [OS Type] $vmname = $args[0] $OSver = $args[1] # OS version - W2K...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/compare-clusters.ps1
compare-clusters.ps1
$outputFile = 'D:\scipts\compare.html' $VCServer = "MyVCServer" Function Create-HTMLTable { param([array]$Array) $arrHTML = $Array | ConvertTo-Html $arrHTML[-1] = $arrHTML[-1].ToString().Replace('</body></html>',"") Return $arrHTML[5..1000] } $output = @() $output += '<html><head></head><body>' $ou...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/DiskInfoRDM.ps1
DiskInfoRDM.ps1
Connect-VIServer vcenter.conseco.ad $report = @() $vms = Get-VM | Get-View foreach($vm in $vms){ foreach($dev in $vm.Config.Hardware.Device){ if(($dev.gettype()).Name -eq "VirtualDisk"){ if(($dev.Backing.CompatibilityMode -eq "physicalMode") -or ($dev.Backing.Compa...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/MoveComputers.ps1
MoveComputers.ps1
$srvs = Get-Content c:\Jake\BLCpcs.txt ForEach($srv in $srvs) { move-qadobject ("CONSECO\" + $srv +"$") -NewParentContainer 'CONSECO.AD/BLC Corp/Computers' }
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.ConnectNetAdapter.ps1
VM.ConnectNetAdapter.ps1
Connect-VIServer vcenter.conseco.ad ForEach ($VM in Get-VM -Location 'Temp Desktops') { ForEach ($NetworkAdapter in $VM.NetworkAdapters) { Write-Host "Set-NetworkAdapter -NetworkAdapter $NetworkAdapter -StartConnected $true" -ForegroundColor Blue Set-NetworkAdapter -NetworkAdapter $NetworkAdap...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/GetNICBindOrder.ps1
GetNICBindOrder.ps1
#region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> # <ScriptPackager> # <process>powershell.exe</process> # <arguments /> # <extractdir>%TEMP%</extractdir> # <files /> # <usedefaulticon>true</usedefaulticon> # <showinsystray>false</showinsystray> # ...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.AddNewPortGroupsToCluster.ps1
VM.AddNewPortGroupsToCluster.ps1
#$vmwareSnapin = Add-PSSnapin "VMware.VimAutomation.Core" -ErrorVariable myErr Connect-VIServer vcenter.conseco.ad get-cluster -name 'ALPHA' | get-vmhost | Get-VirtualSwitch -Name vSwitchFO | New-VirtualPortGroup -Name 'VLAN_211' -VLANID 211 #get-cluster -name 'ALPHA' | get-vmhost | Get-VirtualSwitch -Name vSwit...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/GetIPs.ps1
GetIPs.ps1
#region Vars $DebugPreference = "Continue" $debug = $true $table = New-Object system.Data.DataTable "Server Info" $col01 = New-Object system.Data.DataColumn Server,([string]) $col02 = New-Object system.Data.DataColumn FOIP,([string]) $col03 = New-Object system.Data.DataColumn FOIPGW,([string]) $col04 = Ne...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/SqlSpace.ps1
SqlSpace.ps1
$debug = $true $table = New-Object system.Data.DataTable "Volume" $col01 = New-Object system.Data.DataColumn Server,([string]) $col02 = New-Object system.Data.DataColumn Volumes,([string]) $table.columns.add($col01) $table.columns.add($col02) function getserverinfo([string]$strComputer) { $ComputerSystem = G...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Deploy1NIC.ps1
Deploy1NIC.ps1
#region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> # <ScriptPackager> # <process>powershell.exe</process> # <arguments /> # <extractdir>%TEMP%</extractdir> # <files /> # <usedefaulticon>true</usedefaulticon> # <showinsystray>false</showinsystray> # <al...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/HealthCheck.ps1
HealthCheck.ps1
#region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> # <ScriptPackager> # <process>powershell.exe</process> # <arguments /> # <extractdir>%TEMP%</extractdir> # <files /> # <usedefaulticon>true</usedefaulticon> # <showinsystray>false</showinsystray> # <al...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.DeployXPDMZCSV.ps1
VM.DeployXPDMZCSV.ps1
Connect-VIServer view4vc.conseco.ad $vmcsv = Import-Csv \\ntadminp01\Public\VMware\VMDesktopsXPDMZ1.csv ### Imports VM deployment specs $sourcevm = "WXP-SP3-X86" ### Sets source vm\template ###$rspool = Get-VMHost 'esxalpha01.conseco.com' | Get-ResourcePool '5. Sandbox' ###Shutdown-VM...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Get-SQLVM.datastores.ps1
Get-SQLVM.datastores.ps1
Connect-VIServer vcenter.conseco.ad Get-VM | Where {$_.name -like "NTS8*"} | Select Name, @{N="Datastore";E={($_ | Get-Datastore)}} | Sort Name | Export-Csv C:\NTS8.csv Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VMHost.DisableVAAI.ps1
VMHost.DisableVAAI.ps1
Connect-VIServer vcenter.conseco.ad,view4vc.conseco.ad $VMHosts = Get-VMHost Foreach ($VMHost in $VMHosts) { Set-VMHostAdvancedConfiguration -VMHost $VMHost -Name DataMover.HardwareAcceleratedMove -Value 0 Set-VMHostAdvancedConfiguration -VMHost $VMHost -Name DataMover.HardwareAcceleratedInit -Value 0 Set-VMHos...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.DeployW7CSV.ps1
VM.DeployW7CSV.ps1
Connect-VIServer view4vc.conseco.ad $vmcsv = Import-Csv \\ntadminp01\Public\VMware\VMDesktopsW7.csv ### Imports VM deployment specs $sourcevm = "W7-SP1-X86" ### Sets source vm\template ###$rspool = Get-VMHost 'esxalpha01.conseco.com' | Get-ResourcePool '5. Sandbox' ###Shutdown-VMGuest...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Deploy2NIC.ps1
Deploy2NIC.ps1
#region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> # <ScriptPackager> # <process>powershell.exe</process> # <arguments /> # <extractdir>%TEMP%</extractdir> # <files /> # <usedefaulticon>true</usedefaulticon> # <showinsystray>false</showinsystray> # <al...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Get-HardwareVersion.ps1
Get-HardwareVersion.ps1
Connect-VIServer vcenter.conseco.ad Get-VM |% {Get-View $_.ID} |` % { $vmVersion = $_.Config.Version $vmName = $_.Name if ($vmVersion -eq "vmx-04"){ Write-Host $vmName "uses hardware version 4" } } Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/sql info.ps1
sql info.ps1
function Get-SQL ([string]$Query,[string]$ConnString) { if ($ConnString) { if($ConnString -match '"*"') { $ConnString = $ConnString.TrimStart('"') $ConnString = $ConnString.TrimEnd('"') } } else { # Default Connection String $ConnString = "server=ServerName;database=DbName;trusted_connection=t...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Get-ToolsVersion.ps1
Get-ToolsVersion.ps1
Connect-VIServer vcenter.conseco.ad get-vm | % { get-view $_.ID } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}} | Export-Csv "H:\VMware\vcenterToolsVersion.csv"
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.NICInformation.ps1
VM.NICInformation.ps1
Connect-VIServer vcenter.conseco.ad $vmhosts = Get-Cluster "BETA" | Get-VMHost | Sort Name | Where-Object {$_.State -eq "Connected"} | Get-View $MyCol = @() foreach ($vmhost in $vmhosts){ $ESXHost = $vmhost.Name Write "Collating information for $ESXHost" $networkSystem = Get-view $vmhost.ConfigManager.NetworkS...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/HALvsCPU_CNO.ps1
HALvsCPU_CNO.ps1
connect-viserver ntvcenterp01.conseco.ad $myCol = @() ForEach ($VM in (Get-VM)) { If($VM.Name -notlike 'LX*') { $MyDetails = "" | select-Object Name, HAL, NumvCPU, Mismatch $MYDetails.Name = $VM.Name $Hal = Get-WmiObject -ComputerName $VM.Name -Query "SELECT * FROM Win32_PnPEntity where ClassGuid = '{4D3...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.CloneServerCSV.ps1
VM.CloneServerCSV.ps1
Connect-VIServer vcenter.conseco.ad $vmcsv = Import-Csv \\ntadminp01\Public\VMware\VMServersIA6M.csv ### Imports VM deployment specs $sourcevm = "NTIA6MP01" ### Sets source vm\template ###$rspool = Get-VMHost 'esxalpha01.conseco.com' | Get-ResourcePool '5. Sandbox' ### Shutdown-VMGues...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/movvms.ps1
movvms.ps1
get-vc ntvsvcp01.conseco.ad Move-VM -VM (Get-VM -Name "CCM4") -Destination (Get-Folder -Name "40|86") Move-VM -VM (Get-VM -Name "AUTOFILE") -Destination (Get-Folder -Name "Autosys") Move-VM -VM (Get-VM -Name "AUTOPAGE") -Destination (Get-Folder -Name "Autosys") Move-VM -VM (Get-VM -Name "AUTOPROD1") -Destination (G...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/deployvmDR.ps1
deployvmDR.ps1
#deploy [vmname] [osver] [foip] [fogw] [boip] [vcpus] [rammb] [ddrvgb] [vmhost] [vmdatastore] #'CDPLDC2' 'W2K3-SP1-STD-X86' '192.165.215.27' '192.165.215.1' '10.141.0.250' '1' '2048' '10' 'esxdelta04.conseco.ad' 'DeltaProd4' #'NTEXTDC1' 'W2K3-SP1-STD-X86' '192.168.11.20' '192.168.11.200' '10.141.0.250' '2' '2048' '10...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/Vm.Disk.StoragevMotion - Desktops.ps1
Vm.Disk.StoragevMotion - Desktops.ps1
#$vmwareSnapin = Add-PSSnapin "VMware.VimAutomation.Core" -ErrorVariable myErr Connect-VIServer view4vc.conseco.ad Get-VM -Name "XPONLY-1" | Move-VM -Datastore (Get-Datastore "VMWXPPROX86DESK008") -RunAsync Get-VM -Name "XPUSERD0" | Move-VM -Datastore (Get-Datastore "VMWXPPROX86DESK008") -RunAsync Get-VM -Nam...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/CheckUserDiskSpace.ps1
CheckUserDiskSpace.ps1
$Users = GC "c:\user.lst" $table = New-Object system.Data.DataTable "Server Info" $col01 = New-Object system.Data.DataColumn UserID,([string]) $col02 = New-Object system.Data.DataColumn SpaceUsed,([string]) $table.columns.add($col01) $table.columns.add($col02) ForEach ($User in $Users) { Write-Host "Che...
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/VM.Nframe.Move-vm.v2.ps1
VM.Nframe.Move-vm.v2.ps1
Connect-VIServer vcenter.conseco.ad $vmcsv = Import-Csv "\\ntadminp01\Public\Nframe-Move.csv" Foreach ($line in $vmcsv) { Move-VM -Datastore $line.datastore -VM $line.name -DiskStorageFormat Thin } Disconnect-VIServer -Confirm:$false
PowerShellCorpus/Github/vjacksonr123_powershell/Archive/DeployVMgetfromSD.ps1
DeployVMgetfromSD.ps1
$VMDSfn = "DeployVMfunction.ps1" $VMDSincludes = ($VMDSfn) $VMDSincludes | % { if (Test-Path $_) { . ./$_ Write-Host $_ Loaded } else { Write-Host "Essential file missing." -foregroundcolor "red" Write-Host "Make sure file '$_' is present in the current directory" exit } } $TaskName...