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
echo 'H4sIACqlxVgAA5VUyW7bMBA9218xiA9JANtpeigKFDnkAwoEaG9FEYzFkT0xRapc7Khf30dKNrK0 | |
h54Mk5w3b5nRYr6gG0nNTc/d2tw0vuu8W3HT+OwSrYhz2vmgvzmpdxQlJXXbSOM7Sp7YWhyHgzYS | |
5wugfd9ppFatEH7VNTYbMdQG35FPOwmn16vYS6OtNvRw/xWArtVtrYtLoLAzFHc+W1OuEqsjJqsx | |
kW8JMG+Idd5kVOKGExlp1QlAyrtGXApsCZIkRuq91Wag1gfKUahowKM4xCTdmkBeSjlnmwr95IHi | |
nR1w6IYT8yIbxSHScecBMrkViYOQPPcaIBiEq69xx8Yf19Wa+1jYw2m6XX9Y364+LdH9hVsdO96i | |
djOUR6sicZV7w0nK0cRrXTz2lHiPzubAMGcroysal6SVeJCSkLhiffVk8HnyOIMkuwEo1jcw5mSd | |
aE1nI/AGeIG4TfifXjiyQcV+WbOBfiC8ZQljRg2wykpTowGzMfepEVz+Jn8pvvp8XWMxgrRtLI7h | |
EQql+lp49BJWPTf70uBE+6pcXDwE7TgMFyPF6/kUyexHzDX3u4/k5PhY2iW/fwzyy9wZ787S7nTr | |
IPvnDKQes9PndfT0HuX2P1CO6jbqTAUadVzGqqLFymyggrQl5ychVFuIieemQM8aNclsVvHKBAKs |
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
function check_ambari_user_exists() | |
{ | |
USER_TO_CHECK=$1 | |
# Get list of users in Ambari | |
USER_LIST=$(curl -u "$USERID:$PASSWD" -sS -G "http://${ACTIVEAMBARIHOST}:8080/api/v1/users" | grep 'user_name' | cut -d":" -f2 | tr -d '"','',' ' ) | |
for User in $( echo "$USER_LIST" | tr '\r' ' '); do | |
echo "-${User}-" | |
if [ "$User" == "$USER_TO_CHECK" ];then | |
echo 0 |
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
Login-AzureRmAccount | |
# Create the self signed cert | |
mkdir c:\certificates | |
$currentDate = Get-Date | |
$endDate = $currentDate.AddYears(1) | |
$notAfter = $endDate.AddYears(1) | |
$pwdplaintext = "P@ssW0rd1" |
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
Function Get-AzureRegionPublicIPAddressList | |
{ | |
<# | |
.SYNOPSIS | |
The function lists the public IP addresses in a particular Azure region | |
.DESCRIPTION | |
The function lists the public IP addresses in a particular Azure region. | |
.PARAMETER Region | |
The Azure region for which you want to retrieve public IP addresses. | |
.PARAMETER AzureIPRangeXMLFile |
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
Function Get-AzurePubicIpXMLRegionList | |
{ | |
<# | |
.SYNOPSIS | |
The function takes the Azure Public IP address XML file and returns an array of region names | |
.DESCRIPTION | |
The function takes the Azure Public IP address XML file and returns an array of region names | |
.PARAMETER AzureIPRangeXMLFile | |
The XML file containing the Azure IP ranges. | |
.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
Function Get-AzurePublicIPRangesXMLFile | |
{ | |
<# | |
.SYNOPSIS | |
This function downloads the Azure IP ranges XML file to the current directory or a specified path. | |
.DESCRIPTION | |
This function downloads the Azure IP ranges XML file to the current directory or a specified path. | |
.PARAMETER AzureIPRangeURL | |
An optional parameter that is the URL to the Azure IP range XML file download page. | |
.PARAMETER DestinationPath |
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
<?php | |
$domain = 'acme.local'; | |
$username = 'aduser'; | |
$password = 'replaceWithPassword'; | |
$ldapconfig['host'] = '192.168.21'; | |
$ldapconfig['port'] = 389; | |
$ldapconfig['basedn'] = 'dc=acme,dc=local'; | |
$ldap_dn = "DC=acme,DC=local"; |
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
$username = 'aduser' | |
$password = 'replaceWithPassword' | |
$DomainControllerIpAddress = '192.168.0.21' | |
$LdapDn = 'dc=acme,dc=local' | |
$dn = New-Object System.DirectoryServices.DirectoryEntry ("LDAP://$($DomainControllerIpAddress):389/$LdapDn",$username,$password) | |
# Here look for a user | |
$ds = new-object System.DirectoryServices.DirectorySearcher($dn) | |
$ds.filter = "((userPrincipalName=*))" | |
$ds.SearchScope = "subtree" |
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
$AccountName = 'my-admin' | |
$vmpwd = 'ReplaceWithAStrongPassword' | |
$SecurePassword = ConvertTo-SecureString $vmpwd -AsPlainText -Force | |
$Credential = New-Object System.Management.Automation.PSCredential ($AccountName, $SecurePassword); | |
Import-Module ServerManager | |
Add-WindowsFeature GPMC, Backup-Features, Backup, Backup-Tools,DNS,WINS-Server -Verbose | |
Add-WindowsFeature AS-NET-Framework -Verbose | |
Add-WindowsFeature AD-Domain-Services, ADDS-Domain-Controller -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
# Select a subscritpion | |
Set-AzureRmContext -SubscriptionName (Get-AzureRmSubscription | Out-GridView -PassThru).SubscriptionName | |
$Location = 'North Europe' | |
# Create a resource group for the VM and storage account | |
$CoreInfraResourceGroupName = 'VM-RG-0001' | |
New-AzureRmResourceGroup -Name $CoreInfraResourceGroupName -Location $Location | |
$CoreInfraVMStorageAccount = '0048vhdstorage' |
NewerOlder