Skip to content

Instantly share code, notes, and snippets.

@nivleshc
nivleshc / ConfigureWAP.ps1
Created November 29, 2016 11:08
Configure WAP Service
<#
ConfigureWAP.ps1 is passed the username for an account that has local administrator access on the ADFS Server
#>
param
(
$AdminUsername
)
#password for the local administrator account on the ADFS server is encrypted and stored in a local folder
#define the directory where the files are stored and the key used to encrypt the password, so that the password
@nivleshc
nivleshc / Install_Configure_WAP.json
Created November 29, 2016 11:16
Azure Resource Manager template to use the scripts to install and configure WAP
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('WAP01VMName'),'/InstallWAP')]",
"apiVersion": "2015-05-01-preview",
"location": "[resourceGroup().location]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('WAP01VMName'))]",
"[concat('Microsoft.Compute/virtualMachines/',parameters('ADFS01VMName'),'/extensions/ConfigureADFS')]",
"[concat('Microsoft.Compute/virtualMachines/',parameters('ADFS02VMName'),'/extensions/AddToADFSFarm')]"
],
@nivleshc
nivleshc / Shutdown_Servers.ps1
Created June 7, 2017 02:13
A simple script to shutdown servers
<#
This script will shutdown all servers that are in the @serverlist and are active
Changelog
Date Author Comments
02/06/17 Nivlesh Initial version
#>
$serverlist = @("Server01","Server02","Server03","Server04","Server05")
$server_domainname = "domain.local"
@nivleshc
nivleshc / Find_MailboxPermissions_Dependencies.ps1
Last active April 20, 2022 14:34
A PowerShell Script to find Mailbox Dependencies based on their Permissions
<#
Name : Find_MailboxPermissons_Dependencies.ps1
Author: [email protected]
SCRIPT IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND.
Before running any script, please read the entire script to ensure there is nothing in it that will harm your environment
Requirements:
- Run Roman Zarkar's Export-MailboxPermissions.ps1 (this script is part of the bundle at https://gallery.technet.microsoft.com/scriptcenter/Migrate-Mailbox-Permissions-2f262f8b)
and provide locations of the output files MailboxAccess.csv, MailboxFolderDelegate.csv, MaiboxSendAs.csv, MailboxSendOnBehalf.csv
@nivleshc
nivleshc / CF_Deploying ADDS_Parameters.yaml
Created May 26, 2018 11:44
Parameters for CloudFormation template for Deploying Active Directory Domain Services
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation Template to deploy an EC2 instance and then install ADDS
Parameters:
Client:
Type: String
Description: Summation of client name - to allow same pattern to be used across clients
Default: Nivlesh Chandra
Hostname:
Type: String
Description: Hostname - maximum 15 characters
@nivleshc
nivleshc / CF_Deploying_ADDS_Mappings.yaml
Created May 26, 2018 12:00
These are the mappings used in the CloudFormation template for deploying Active Directory Domain Services
Mappings:
AMIMap:
WindowsServer2012R2Base:
"ImageId": "ami-2a9a1655"
WindowsServer2016Base:
"ImageId": "ami-f0df538f"
SubnetMap:
us-east-1a:
Dev: "subnet-cf2ee1a8"
Test: "ssubnet-5f25ea38"
@nivleshc
nivleshc / CF_Deploying_ADDS_Roles_Policies.yaml
Last active May 31, 2018 17:28
The roles and policies used to access the S3 bucket when deploying an Active Directory Domain Services using CloudFormation
Profile:
Type: 'AWS::IAM::InstanceProfile'
Properties:
Roles:
- !Ref HostRole
Path: /
InstanceProfileName: !Join
- ''
- - 'instance-profile-'
- !Ref S3BucketName
@nivleshc
nivleshc / CF_Deploying_ADDS_Metadata.yaml
Last active May 31, 2018 17:31
The Metadata that will be configured for the Instance
Metadata:
'AWS::CloudFormation::Authentication':
S3AccessCreds:
type: S3
buckets:
- !Ref S3BucketName
roleName: !Ref HostRole
'AWS::CloudFormation::Init':
configSets:
config:
@nivleshc
nivleshc / CF_Deploying_ADDS_Properties_Tags_Outputs.yaml
Created May 26, 2018 12:47
This is the rest of the CloudFormation template for deploying Active Directory Domain Services
Properties:
DisableApiTermination: 'false'
AvailabilityZone: !Sub "${AvailabilityZone}"
InstanceInitiatedShutdownBehavior: stop
IamInstanceProfile: !Ref Profile
ImageId: !FindInMap [ AMIMap, !Ref OS, ImageId ]
InstanceType: !Sub "${InstanceSize}"
KeyName: !Sub "${KeyPair}"
UserData: !Base64
'Fn::Join':
@nivleshc
nivleshc / CF_Deploying_ADDS.yaml
Last active June 3, 2022 09:42
Deploying Active Directory Domain Services using AWS CloudFormation
AWSTemplateFormatVersion: 2010-09-09
Description: CloudFormation Template to deploy an EC2 instance and then install ADDS
Parameters:
Client:
Type: String
Description: Summation of client name - to allow same pattern to be used across clients
Default: Nivlesh Chandra
Hostname:
Type: String
Description: Hostname - maximum 15 characters