full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestPWSConnectivity.ps1
TestPWSConnectivity.ps1
#=================================================================== # Test PowershellConnectivity #=================================================================== #write-Output "..Test PowershellConnectivity" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if (...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestPowershellConnectivity.ps1
TestPowershellConnectivity.ps1
#=================================================================== # Test Powershell Connectivity #=================================================================== #Write-Output "..Powershell Connectivity" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SR...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/MBXRPCClientAccessServer.ps1
MBXRPCClientAccessServer.ps1
#=================================================================== # Mailbox Server - RPCClientAccessServer #=================================================================== # write-Output "..Mailbox Server - RPCClientAccessServer" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/MBXBackup.ps1
MBXBackup.ps1
#=================================================================== # Mailbox Server - Backup #=================================================================== # write-Output "..Mailbox Server - Backup" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSet...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/ExchangeRollupE2K7.ps1
ExchangeRollupE2K7.ps1
#=================================================================== # Exchange Rollup (Edge server excluded) #=================================================================== #write-Output "..Exchange Servers Rollup (E2K7 Only)" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADS...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/DAGDBSize.ps1
DAGDBSize.ps1
#=================================================================== # Database Availability Group - Database Size and Availability #=================================================================== #write-Output "..Database Availability Group - Database Size and Availability" Add-PSSnapin Microsoft.Exchange.Mana...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/CASOAB.ps1
CASOAB.ps1
#=================================================================== # Client Access Server - OAB Virtual Directory #=================================================================== #write-Output "..Client Access Server - OAB Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSet...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestASConnectivity.ps1
TestASConnectivity.ps1
#=================================================================== # Test ActiveSync Connectivity #=================================================================== #Write-Output "..Test ActiveSync Connectivity" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/PowershellVD.ps1
PowershellVD.ps1
#=================================================================== # Client Access Server - Powershell Virtual Directory #=================================================================== #write-Output "..Powershell Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = G...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/ExchangeServices.ps1
ExchangeServices.ps1
#=================================================================== # Exchange Services #=================================================================== #Write-Output "..Exchange Services" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSettings.ViewEnt...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/DAGRPCClientAccessServer.ps1
DAGRPCClientAccessServer.ps1
#=================================================================== # Database Availability Group - RPCClientAccessServer #=================================================================== #write-Output "..Database Availability Group - RPCClientAccessServer" Add-PSSnapin Microsoft.Exchange.Management.PowerShell....
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/HardwareInformation.ps1
HardwareInformation.ps1
#=================================================================== # Hardware information #=================================================================== #write-Output "..Hardware Information" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSettings.V...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/DiskInformation.ps1
DiskInformation.ps1
#=================================================================== # Disk Report Information #=================================================================== #Write-Output "..Logical Disk & MountPoint Report Information" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerS...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/CASWebServices.ps1
CASWebServices.ps1
#=================================================================== # Client Access Server - WebServices Virtual Directory #=================================================================== #write-Output "..Client Access Server - WebServices Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerShel...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/DAGNetwork.ps1
DAGNetwork.ps1
#=================================================================== # Database Availability Group - Network #=================================================================== #write-Output "..Database Availability Group - Network" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-AD...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/Header.ps1
Header.ps1
#################################################################### # MICROSOFT - Exchange 2010 Architecture Report # # File : E2K10_Architecture.ps1 # Version : 2.0 # Author : Pascal Theil & Franck Nerot # Author Company : MICROSOFT # Author Mail : ptheil@microsoft.com & franckn@microsoft.com # Creation date ...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestMailflow.ps1
TestMailflow.ps1
#=================================================================== # Test Mailflow #=================================================================== #Write-Output "..Test Mailflow" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSettings.ViewEntireFores...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/CASActiveSync.ps1
CASActiveSync.ps1
#=================================================================== # Client Access Server - ActiveSync Virtual Directory #=================================================================== #write-Output "..Client Access Server - ActiveSync Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerShell....
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/CASOWA.ps1
CASOWA.ps1
#=================================================================== # Client Access Server - OWA Virtual Directory #=================================================================== #write-Output "..Client Access Server - OWA Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSet...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/ExchangeServersInformation.ps1
ExchangeServersInformation.ps1
#=================================================================== # Exchange Servers Information #=================================================================== #write-Output "..Exchange Servers Information" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/DAGInformation.ps1
DAGInformation.ps1
#=================================================================== # Database Availability Group - Information #=================================================================== #write-Output "..Database Availability Group - Information" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings ...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestOLConnectivity.ps1
TestOLConnectivity.ps1
#=================================================================== # Test OutlookConnectivity #=================================================================== #write-Output "..Test OutlookConnectivity" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSe...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/ExchangeRollup.ps1
ExchangeRollup.ps1
#=================================================================== # Exchange Rollup (Edge server excluded) #=================================================================== #write-Output "..Exchange Servers Rollup (E2K10 Only)" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-AD...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/ActiveDirectory.ps1
ActiveDirectory.ps1
#=================================================================== # Active Directory Information #=================================================================== #Write-Host "..Active Directory Information" #start-Transcript -path .\ActiveDirectory.log -append #$error.clear() Add-PSSnapin Microsoft.Exchang...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/SetSPNDupl.ps1
SetSPNDupl.ps1
#=================================================================== # SetSPN - Duplicate #=================================================================== #write-Output "..SetSPN - Duplicate" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSettings.ViewE...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/DAGBackup.ps1
DAGBackup.ps1
#=================================================================== # Database Availability Group - Backup #=================================================================== #write-Output "..Database Availability Group - Backup" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADSe...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/HUBBackPressure.ps1
HUBBackPressure.ps1
#=================================================================== # HUB Transport - Back Pressure (E2K10 Only) #=================================================================== #write-Output "..HUB Transport - Back Pressure Events (E2K10 Only)" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRV...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/SetSPNView.ps1
SetSPNView.ps1
#=================================================================== # SetSPN - Viewing #=================================================================== #write-Output "..SetSPN - Viewing" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSettings.ViewEntir...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/MBXCalRepairAssistant.ps1
MBXCalRepairAssistant.ps1
#=================================================================== # Mailbox Server - Calendar Repair Assistant #=================================================================== #Write-Output "..Mailbox Server - Calendar Repair Assistant" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSetting...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/MBXOAB.ps1
MBXOAB.ps1
#=================================================================== # Mailbox Server - OfflineAddressBook #=================================================================== #write-Output "..OfflineAddressBook" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestMAPIConnectivity.ps1
TestMAPIConnectivity.ps1
#=================================================================== # Test MAPI Connectivity - Mailbox and Public Folder Databases #=================================================================== #Write-Output "..Test MAPI Connectivity - Mailbox and Public Folder Databases" Add-PSSnapin Microsoft.Exchange.Mana...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/CASAutodiscover.ps1
CASAutodiscover.ps1
#=================================================================== # Client Access Server - Autodiscover Virtual Directory #=================================================================== #write-Output "..Client Access Server - Autodiscover Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerSh...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/MBXDBSize.ps1
MBXDBSize.ps1
#=================================================================== # Mailbox Server - Database Size and Availability #=================================================================== #write-Output "..Mailbox Server - Database Size and Availability" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestECPConnectivity.ps1
TestECPConnectivity.ps1
#=================================================================== # Test ECP Connectivity #=================================================================== #Write-Output "..Test ECP Connectivity" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSettin...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/TestOutlookWebServices.ps1
TestOutlookWebServices.ps1
#=================================================================== # Test Outlook Web Services #=================================================================== #Write-Output "..Outlook Web Services" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSettings = Get-ADServerSettings if ($SRVSetti...
PowerShellCorpus/Github/bhaskar39_AllScripts/AD and Exchange/Scripts/CASECP.ps1
CASECP.ps1
#=================================================================== # Client Access Server - ECP Virtual Directory #=================================================================== #write-Output "..Client Access Server - ECP Virtual Directory" Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 $SRVSet...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/FetchRateCard.ps1
FetchRateCard.ps1
# To pull the data from Azure for VM Sizes $AppSecretKey = "FTaN7/A5X2okYRc5xkee/AVokyNP3BJ7UqbCOqBRzTo=" $ClientID = "ec4c2b83-79e9-48d5-830b-cbcbf3b0a66f" $TenantID = "163304dc-3d1d-40d1-9589-7e1673369634" $SubscriptionID = "ca68598c-ecc3-4abc-b7a2-1ecef33f278d" Function New-AzureRestAuthorizationHeader { ...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/VmConfig.ps1
VmConfig.ps1
# To pull the data from Azure for VM Sizes $AppSecretKey = "FTaN7/A5X2okYRc5xkee/AVokyNP3BJ7UqbCOqBRzTo=" $ClientID = "ec4c2b83-79e9-48d5-830b-cbcbf3b0a66f" $TenantID = "163304dc-3d1d-40d1-9589-7e1673369634" $SubscriptionID = "ca68598c-ecc3-4abc-b7a2-1ecef33f278d" Function New-AzureRestAuthorizationHeader { ...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/CopyBakFileandRemoveShare.ps1
CopyBakFileandRemoveShare.ps1
<# #> Begin { # Name the Log file based on script name [DateTime]$LogFileTime = Get-Date $FileTimeStamp = $LogFileTime.ToString("dd-MMM-yyyy_HHmmss") $LogFileName = "$ClientID-$($MyInvocation.MyCommand.Name.Replace('.ps1',''))-$FileTimeStamp.log" $LogFilePath = "C:\MapTool\$LogFileName" ...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/storedProc.ps1
storedProc.ps1
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection $SqlConnection.ConnectionString = "integrated security=false;Database=ASSESS-MGMT;server=localhost;uid=sa;pwd=pass12345@word" $SqlCmd = New-Object System.Data.SqlClient.SqlCommand $SqlCmd.CommandText = "p_CreateCustomer" $SqlCmd.Connection = $SqlConnec...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/ImportDB.ps1
ImportDB.ps1
<# .SYNOPSIS It is a standaole script for installing the MAP Tool. #> Begin { $Script:CustomerName = $args[0] $Script:UserName = $args[1] $Script:Password = $args[2] # Name the Log file based on script name [DateTime]$LogFileTime = Get-Date $FileTimeStamp = $LogFileTime.To...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/Scripts/MapTool.ps1
MapTool.ps1
<# .SYNOPSIS It is a standaole script for installing the MAP Tool. #> Begin { # Name the Log file based on script name [DateTime]$LogFileTime = Get-Date $FileTimeStamp = $LogFileTime.ToString("dd-MMM-yyyy_HHmmss") $LogFileName = "$ClientID-$($MyInvocation.MyCommand.Name.Replace('.ps...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/Scripts/ExportDB.ps1
ExportDB.ps1
<# .SYNOPSIS It is a standaole script for installing the MAP Tool. #> Begin { #$Script:UserName = $args[0] #$Script:Password = $args[1] $Script:DatabaseName = $args[0] # Name the Log file based on script name [DateTime]$LogFileTime = Get-Date $FileTimeStamp = $LogFileTime.To...
PowerShellCorpus/Github/bhaskar39_AllScripts/RoI/Scripts/ImportDB1.ps1
ImportDB1.ps1
<# .SYNOPSIS It is a standaole script for installing the MAP Tool. #> Begin { $Script:PartnerName = $args[0] $Script:ClientName = $args[1] $Script:Region = $args[2] $Script:UserName = $args[3] $Script:Password = $args[4] # Name the Log file based on script name [DateT...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL Migration/TestDBAccess.ps1
TestDBAccess.ps1
Param ( [Parameter(mandatory=$true)] $SQLServerName, [Parameter(mandatory=$true)] $DataBaseName, [Parameter(mandatory=$true)] $DBUserName, [Parameter(mandatory=$true)] $DBPassword, $SQLQuery ) try { $SqlConnection = New-Object System.Data.SqlClient.SqlConnection ...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL Migration/CopyFile.ps1
CopyFile.ps1
Param ( [Parameter(Mandatory=$true)] $SourcePath, [Parameter(Mandatory=$true)] $destinationPath ) Try { If(!(Test-Path -Path $destinationPath)) { $FolderStatus = New-Item -Path $destinationPath -ItemType Directory -Force -ErrorAction Stop } if(Test-Path -Path $Sour...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL Migration/RestoreDBfromBakFile.ps1
RestoreDBfromBakFile.ps1
Param ( [Parameter(mandatory=$true)] $DBUserName, [Parameter(mandatory=$true)] $DBPassword, [Parameter(mandatory=$true)] $BackupFilePath ) try { if(Test-Path -Path $BackupFilePath) { $DestinationDBName = (Split-Path $BackupFilePath -Leaf).Replace('.bak','') ...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL Migration/RemoveOrphanUsers.ps1
RemoveOrphanUsers.ps1
Param ( [Parameter(mandatory=$true)] $SQLServerName, [Parameter(mandatory=$true)] $DataBaseName, [Parameter(mandatory=$true)] $DBUserName, [Parameter(mandatory=$true)] $DBPassword ) try { $SqlConnection = New-Object System.Data.SqlClient.SqlConnection $SqlConnecti...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/CreateVmFromDisk.ps1
CreateVmFromDisk.ps1
# Fetching the Network details $VNet = Get-AzureRmVirtualNetwork -Name Automation-VNet -ResourceGroupName resourcegrp-bhaskar #Fetching the Subnet Details $SNet = Get-AzureRmVirtualNetworkSubnetConfig -Name InfraSubnet -VirtualNetwork $VNet # Create Public IP $PublicIPStatus = New-AzureRmPublicIpAddress ...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/NetworkTraffic.ps1
NetworkTraffic.ps1
#START NETWORK TRACES ON REMOTE COMPUTERS #Specify target computer name $computers= @("13.68.109.96") $creds = New-Object System.Management.Automation.PSCredential ('ebabula',(ConvertTo-SecureString -AsPlainText -String pass12345@word -Force)) #Drive letter on remote computers to create output folder under $drive=...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/textToCSV.ps1
textToCSV.ps1
$rawData = New-Object System.Collections.ArrayList $rawData1 = New-Object System.Collections.ArrayList $rawData = Get-Content 'F:\AdHoc Scripts\temp.txt' $rawData1 = Get-Content 'F:\AdHoc Scripts\temp1.txt' $rawData = $rawData | select -Skip 1 $rawData1 = $rawData1 | select -Skip 1 $Obj1 = New-Object System.C...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/PullServer.ps1
PullServer.ps1
configuration Sample_xDscWebService { param ( [string[]]$NodeName = 'WIN-2LADSKQ28VD', [ValidateNotNullOrEmpty()] [string] $certificateThumbPrint = "AllowUnencryptedTraffic" ) Import-DSCResource -ModuleName PSDesiredStateConfiguration,xPSDesiredStateConfiguration ...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/SubscriptionDetails.ps1
SubscriptionDetails.ps1
Param ( [string]$UserName, [string]$Password, [string]$SubscriptionID ) Try { $secString = ConvertTo-SecureString -String $Password -AsPlainText -Force $CredObj = New-Object System.Management.Automation.PSCredential ($UserName,$secString) $CompleteObj = New-Object System.Collection...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/Inventory1.ps1
Inventory1.ps1
<# .SYNOPSIS Script to get the server information i.e Roles, features and applicaitions .DESCRIPTION Script to get the server information i.e Roles, features and applicaitions .PARAMETER CSVFilePath Servers list in csv format with credentials .AUTHOR Bhaskar Desharaju - bhaskar....
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/PublicAndNIC_List.ps1
PublicAndNIC_List.ps1
$AllPublicIps = Get-AzureRmPublicIpAddress $PublicIpList = New-Object System.Collections.ArrayList foreach ( $publicip in $AllPublicIps) { $c = new-object -TypeName PSObject $c | Add-Member -MemberType NoteProperty -Name PublicIPName -Value $publicip.Name $c | Add-Member -MemberType NoteProper...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/AddMultiplePIP.ps1
AddMultiplePIP.ps1
$vm = Get-AzureRMVM -Name diva-v3-dev-api -ResourceGroupName diva-v3-dev $nic = Get-AzureRmNetworkInterface -Name diva-v3-dev-api961 -ResourceGroupName diva-v3-dev Register-AzureRmProviderFeature -FeatureName AllowMultipleIpConfigurationsPerNic -ProviderNamespace Microsoft.Network Register-AzureRmProviderFea...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/BillInformation.ps1
BillInformation.ps1
Param ( [string]$StartDate, [string]$EndDate ) $AppSecretKey = "FTaN7/A5X2okYRc5xkee/AVokyNP3BJ7UqbCOqBRzTo=" $ClientID = "ec4c2b83-79e9-48d5-830b-cbcbf3b0a66f" $TenantID = "163304dc-3d1d-40d1-9589-7e1673369634" $SubscriptionID = "ca68598c-ecc3-4abc-b7a2-1ecef33f278d" Function New-AzureRestAuthoriz...
PowerShellCorpus/Github/bhaskar39_AllScripts/AdHoc Scripts/PullResourceDetails.ps1
PullResourceDetails.ps1
Param ( [string]$UserName, [string]$Password, [string]$SubscriptionID ) Try { $secString = ConvertTo-SecureString -String $Password -AsPlainText -Force $CredObj = New-Object System.Management.Automation.PSCredential ($UserName,$secString) Login-AzureRmAccount -Credential $Cre...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL scripts/SQLServerReport.ps1
SQLServerReport.ps1
# Get the Server Name $hostname = $env:COMPUTERNAME # Get the available SQL Server Instances in the Server $SQLServerInstances = (Get-ItemProperty 'HKLM:\Software\Microsoft\Microsoft SQL Server').InstalledInstances # SQL Query Text for fetching the data $sqlquery = @" --drop table #jobstst --drop table #jobs...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL scripts/Script1.ps1
Script1.ps1
try { $SQLQuery = @" SELECT dtl.request_session_id AS WaitingSessionID, der.blocking_session_id AS BlockingSessionID, --dowt.resource_description, der.wait_type, ((dowt.wait_duration_ms)/60000) as Blocking_Since_Minutes, DB_NAME(dtl.resource_database_id) AS ...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL scripts/SqlSanityCheck.ps1
SqlSanityCheck.ps1
###########################################Function1:services list########################################### function ServiceInfo() { [Int]$Count = 0 $hostname ="." $service = get-wmiobject -class win32_service | where {$_.name -like '*MSSQLSERVER'} if($service.state -eq "Running" -or $service.status -eq ...
PowerShellCorpus/Github/bhaskar39_AllScripts/SQL scripts/BlockingScript.ps1
BlockingScript.ps1
#Param #( # [string]$SQLServerInstance #) try { $SQLQuery = @" WITH [Waits] AS (SELECT [wait_type], [wait_time_ms] / 1000.0 AS [WaitS], ([wait_time_ms] - [signal_wait_time_ms]) / 1000.0 AS [ResourceS], [signal_wait_time_ms] / 1000.0 AS [SignalS], ...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCL ScriptForMultipleInstances_updated/UpdateAzureVMSize.ps1
UpdateAzureVMSize.ps1
################################################################################################################# #.VERSION # Script Name : UpdateAzureVMSize.ps1 # VERSION : 1.0 # Date of Authoring & Update : 19-Feb-2015 & 20-Feb-2015 1st Update # #.AUTHOR # Bhaskar ...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCL ScriptForMultipleInstances_updated/ScriptForMultipleVMs.ps1
ScriptForMultipleVMs.ps1
################################################################################################################# #.VERSION # Script Name : ScriptForMultipleVMs.ps1 # VERSION : 1.0 # Date of Authoring : 5th-Feb-2015 # Updates : 20-Feb-2015 # ...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/CreateVirtualMachineSplunk.ps1
CreateVirtualMachineSplunk.ps1
<####################################################################################################################################### # .VERSION # Script File Name :VMVNetEndPoint.ps1 # Date of Updation :10-07-2014 # # .AUTHOR # # Bhaskar Desharaju # # .SYNOPSIS # # ...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/VMVNetEndPoint.ps1
VMVNetEndPoint.ps1
<# .VERSION Script File Name :VMVNetEndPoint.ps1 Version :1.1 Date of Updation :08-07-2014 .AUTHOR Bhaskar Desharaju .SYNOPSIS The script is to provide the fucntions for creating the Virtual Machine and Network config validation and add...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/CloudServiceModule.ps1
CloudServiceModule.ps1
<# .DESCRIPTION This is the Module which provides functions for cloud service opeerations such as Create, Delete, Start and Stopping. .AUTHOR BHASKAR DESHARAJU .USAGE Import this module into the script from where you want to operate the cloud servive and pass the parameters to ...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/VnetSubnetIP.ps1
VnetSubnetIP.ps1
Function VnetSubnetIPValidation { Param( [Parameter(Mandatory=$true)] [string]$GivenSubNet, [Parameter(Mandatory=$true)] [string]$GivenIPAddress, [Parameter(Mandatory=$true)] [string]$GivenVnet, [Parameter(Mandatory=$true)] [string]$Path, [Parameter(Mandatory=$tr...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/StorageAccountModule.ps1
StorageAccountModule.ps1
<# .DESCRIPTION This is the module which provides function to operate on Azure Storage. .AUTHOR BHASKAR DESHARAJU .USAGE Import this module and call the storage functions with necessary parameters #> ################################################# Fcuntion to check the stor...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/ReginalVirtualNetworkCreation.ps1
ReginalVirtualNetworkCreation.ps1
<# .VERSION Script File Name :ReginalVirtualNetworkCreation.ps1 Version :1.1 Date of Updation :02-07-2014 .AUTHOR Bhaskar Desharaju .SYNOPSIS Creating the Regional Virtual Network in Site-to-Site scenario .DESCRIPTION ...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/MasterExceptionHandling.ps1
MasterExceptionHandling.ps1
<# .SYNOPSIS The script to check the subscriptions .DESCRIPTION This is to check the availability of the subscription and gives the option to import the publish settings file, if is not imported. .NOTES Author : Bhaskar Desharaju Last Modified : 02-07-2015...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/CreateVirtualMachine.ps1
CreateVirtualMachine.ps1
param ( [parameter(Mandatory=$true)] [string]$Subscription, [parameter(Mandatory=$false)] [string]$ImportFilePath, [parameter(Mandatory=$true)] [ValidateSet("Windows","Linux")] [string]$OSType, [parameter(Mandatory=$true)] [stri...
PowerShellCorpus/Github/bhaskar39_AllScripts/HCLFor Demo-24-01-2015 as on 12-02-15/InstallWinRMCertAzureVM.ps1
InstallWinRMCertAzureVM.ps1
<# .SYNOPSIS Downloads and installs the certificate created or initially uploaded during creation of a Windows based Windows Azure Virtual Machine. .DESCRIPTION Downloads and installs the certificate created or initially uploaded during creation of a Windows based Windows Azure Virtual Machine. Running this ...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/GetIPRange.ps1
GetIPRange.ps1
<# .SYNOPSIS Get the IP addresses in a range .EXAMPLE Get-IPrange -start 192.168.8.2 -end 192.168.8.20 .EXAMPLE Get-IPrange -ip 192.168.8.2 -mask 255.255.255.0 .EXAMPLE Get-IPrange -ip 192.168.8.3 -cidr 24 #> function Get-IPrange { param ( [strin...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/Persistence.ps1
Persistence.ps1
$vippersistence = New-object -TypeName iControl.LocalLBVirtualServerVirtualServerPersistence; $vippersistence.profile_name = "dest_addr" $vippersistence.default_profile = "dest_addr" $GetF5.LocalLBVirtualServer.add_persistence_profile("demo_80_vs",$vippersistence) $GetF5.LocalLBVirtualServer.get_persistence_profi...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/Health-Monitor.ps1
Health-Monitor.ps1
Add-PSSnapin iControlSnapIn $obj = New-Object -TypeName iControl.GlobalLBMonitorCommonAttributes $MonTemp = New-Object -TypeName iControl.LocalLBMonitorMonitorTemplate $MonTemp.template_name = "http_demo_temp2" $MonTemp.template_type = 'TTYPE_HTTP' $MonAttr = New-Object -TypeName iControl.LocalLBMonitorCommonAtt...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/AddProfile.ps1
AddProfile.ps1
$profName = "http_demo" $obj = New-Object -TypeName iControl.LocalLBVirtualServerVirtualServerPersistence $obj.profile_name = $profName $obj.default_profile = $true $GetF5.LocalLBVirtualServer.add_persistence_profile("demo_80_vs",$obj) #Add HTTP $vipprofilehttp = New-Object "iControl.LocalLBVirtualServerVirtual...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/CommonFileHelp.ps1
CommonFileHelp.ps1
#Initialise: Add-PSSnapin iControlSnapIn $uname = "admin" $password = "Admin098" $password = ConvertTo-SecureString -String $password -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $uname,$password Initialize-F5.iControl -HostName 52.24.197.85 -PSCredentia...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/VSCreation.ps1
VSCreation.ps1
$vipDefs = new-object "iControl.CommonVirtualServerDefinition[]" 1 $vipDefs[0] = new-object "iControl.CommonVirtualServerDefinition" $vipDefs[0].address = "10.10.10.10"; $vipDefs[0].name = "demo_80_vs" $vipDefs[0].port = 0; $vipDefs[0].protocol = [iControl.CommonProtocolType]::PROTOCOL_ANY; $wildmask = @("255.255...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/CreateStaticRoute.ps1
CreateStaticRoute.ps1
#$Dom = New-Object -TypeName iControl.NetworkingRouteTableRouteDefinition #$Dom. #$Def1 = New-Object -TypeName iControl.NetworkingRouteTableRouteDefinition #$Def1.destination = "0.0.0.0" #$Def1.netmask = "255.255.255.255" $Attribute = New-Object -TypeName iControl.NetworkingRouteTableRouteAttribute $Attribute.g...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/SampleCodeFlow.ps1
SampleCodeFlow.ps1
# Function to do initialization function Do_Initialize { Param ( [Parameter(Mandatory=$true)] [string]$HostName, [Parameter(Mandatory=$true)] [string]$UserName, [Parameter(Mandatory=$true)] [string]$PassWord ) if((Get-PSSnapin | Where-Object ...
PowerShellCorpus/Github/bhaskar39_AllScripts/pseudocodeVIP/VIPPoolCReate.ps1
VIPPoolCReate.ps1
$vipName = "demovip" [int[]]$ports = (80,443) [string[]]$ips = @('10.40.0.1','10.40.0.2') $names = @() $lbMethod = "LB_METHOD_ROUND_ROBIN" $Mon = 'YES' try { if($ports.Length -gt 1) { foreach($port in $ports) { $names += $vipName + "_" +$port +"_" + "pl" } ...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/Add_Persistence.ps1
Add_Persistence.ps1
$user=$args[0] $password=$args[1] $F5Box=$args[2] $inputPersistenceName=$args[3] $VSName=$args[4] Function Is-PersistencesExists() { Param ( # Name of the Persistence to be checked [Parameter(Mandatory=$true)] [string]$PersistenceName, # F5 box connection object ...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/add_routesserver.ps1
add_routesserver.ps1
$user="admin"#$args[0] $pass="Admin098"#$args[1] $F5box="52.11.186.160"#$args[2] $destination="10.0.0.50"#$args[3] $netMask="255.255.255.255"#$args[4] $poolName="test_80_pl"#$args[5] Function Get-F5Connection($username,$password, $F5boxhostname) { try { Add-PSSnapin iControlSnapIn $passwo...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/create_VIP.ps1
create_VIP.ps1
$vipip=$args[0] $VSName=$args[1] $VSPort=$args[2] $wildmask="255.255.255.255" $defPool=$VSName+"_"+$VSPort+"_"+"pl" $user=$args[3] $password=$args[4] $f5box=$args[5] Function Get-F5Connection($username,$password, $F5boxhostname) { try { Add-PSSnapin iControlSnapIn $password = ConvertTo-...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/create_VIPpool.ps1
create_VIPpool.ps1
$vipname=$args[0] $port=$args[1] $ip=$args[2] $lb=$args[3] $monitor=$args[4] $user=$args[5] $passwrd = $args[6] $f5=$args[7] $ports=@() $ports+=$port $ips = @() $ip = $ip.Split(",") foreach($i in $ip) { $ips+=$i } Function Get-F5Connection($username,$password, $F5boxhostname) { try { ...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/create_SNATpool.ps1
create_SNATpool.ps1
$vipname=$args[0] $snat=$args[1] $userName=$args[2] $password=$args[3] $f5=$args[4] Function Get-F5Connection($username,$password, $F5boxhostname) { try { Add-PSSnapin iControlSnapIn $password = ConvertTo-SecureString -String $password -AsPlainText -Force $cred = New-Object -TypeName...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/F5connection.ps1
F5connection.ps1
Function Get-F5Connection($username,$password, $F5boxhostname) { try { Add-PSSnapin iControlSnapIn $password = ConvertTo-SecureString -String $password -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$password #Initial...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/KCT 382 Non EFL VIP_Incomplete.ps1
KCT 382 Non EFL VIP_Incomplete.ps1
workflow KCT0000382_NON_EFL_VIP { param( [Parameter (Mandatory=$true)] [string]$rfcNumber, #Ticket number from ITSM [Parameter (Mandatory=$true)] [string]$ProcessID, # [Parameter (Mandatory=$true)] [string]$serverName, #Nodes which need to be added to VIP [Parameter (Mandatory=$true)] [string]$...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/CreateAddPersistence.ps1
CreateAddPersistence.ps1
<# .SYNOPSIS This is to check whether the persistnce is already available in F5 box level .DESCRIPTION .PARAMETERS .EXAMPLES #> Function Is-PersistencesExists { Param ( # Name of the Persistence to be checked [Parameter(Mandatory=$true)] [string]$PersistenceName, ...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/persistence.ps1
persistence.ps1
$outputStatus = Create-Persistence -Persistence_Name $Persistence_Name -Cookie_Persistence_method_value $Cookie_Persistence_method_value -Cookie_Name $Cookie_Name -Cookie_Flag $Cookie_Flag -Persistence_Time $Persistence_Time -Persistence_Time_Flag $Persistence_Time_Flag $activityLog = Write-ActivityLog "$Using:dbSer...
PowerShellCorpus/Github/bhaskar39_AllScripts/F5BoxScript/Create-persistence-new/Create-persistence-new.ps1
Create-persistence-new.ps1
Function Get-Inputs() { try { #Read all lines in the input text file #$Lines = Get-Content -Path $ServersListPath; # Finds the value that user has selected. # foreach ($Line in $Lines) # { # $LineData = "$Line".Split("`t"); # if($LineData[0] -eq "Persistence_Type") # ...
PowerShellCorpus/Github/marcosdassienoronha_RepositorioChatBotBanco1500/ChatBot/packages/Newtonsoft.Json.8.0.3/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://www.newtonsoft.com/json/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindo...
PowerShellCorpus/Github/marcosdassienoronha_RepositorioChatBotBanco1500/ChatBot/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/marcosdassienoronha_RepositorioChatBotBanco1500/ChatBot/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/Fab-IT-ApS_chocolatey-qtpass/QtPass/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
$ErrorActionPreference = 'Stop'; $packageName = 'qtpass' $registryUninstallerKeyName = 'qtpass' $msiProductCodeGuid = '{insert it here}' $shouldUninstall = $true $local_key = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\$registryUninstallerKeyName" $local_key6432 = "HKCU:\Software\Wow6432N...
PowerShellCorpus/Github/Fab-IT-ApS_chocolatey-qtpass/QtPass/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
$ErrorActionPreference = 'Stop'; $packageName = 'qtpass' $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $url = 'https://github.com/IJHack/qtpass/releases/download/v1.0.6/qtpass-1.0.6.exe' $packageArgs = @{ packageName = $packageName unzipLocation = $toolsDir fileType = ...
PowerShellCorpus/Github/OPSTest_NewC.zh-hk/.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/lukaszmarkiewicz_PartyInvites/PartyInvites/packages/jQuery.1.10.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/lukaszmarkiewicz_PartyInvites/PartyInvites/packages/jQuery.1.10.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...