Use Robocopy to Preseed Files for DFS Replication I’ll write this here first, since it’s important: The folder in which you are robo-copying (ex c:\test) must not exist on the destination server (ex. f:\test). If you create the folder manually on the destination server, the file-hashes will not match and DFSr will …
Familiar looking commands like Dir or Ls are in fact Powershell aliases of Get-Childitem. There are many built-in aliases in Powershell and you can even create your own, using the New-Alias cmdlet eg.
1 |
New-Alias -Name "exp" explorer |
To get a list of aliases on your system run:
1 |
Get-Alias | Select name, resolvedcommand | Export-Csv -Path c:\temp\alias3.csv -NoTypeInformation |
The default Aliases …
I’m sure for anyone who administers Microsoft Windows Server the Server Manager console is an all too familiar place. It does make it easy to add/remove roles and features however PowerShell is another great option that can really speed things up at times. So – what can we do with …
Have you ever thought about what actually happens when you import applications into your MDT environment? How does the task sequence know what application to install? How does it know what command-line arguments to specify during the application install process? Technically, as a user, all that is required of us …
This powershell script copies the contents of an S3 bucket to your pc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# Your account access key - must have read access to your S3 Bucket $accessKey = "YOUR-ACCESS-KEY" # Your account secret access key $secretKey = "YOUR-SECRET-KEY" # The region associated with your bucket e.g. eu-west-1, us-east-1 etc. (see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-regions) $region = "eu-west-1" # The name of your S3 Bucket $bucket = "my-test-bucket" # The folder in your bucket to copy, including trailing slash. Leave blank to copy the entire bucket $keyPrefix = "my-folder/" # The local file path where files should be copied $localPath = "C:\s3-downloads\" $objects = Get-S3Object -BucketName $bucket -KeyPrefix $keyPrefix -AccessKey $accessKey -SecretKey $secretKey -Region $region foreach($object in $objects) { $localFileName = $object.Key -replace $keyPrefix, '' if ($localFileName -ne '') { $localFilePath = Join-Path $localPath $localFileName Copy-S3Object -BucketName $bucket -Key $object.Key -LocalFile $localFilePath -AccessKey $accessKey -SecretKey $secretKey -Region $region } } |
Source
The AWS GUI console is a basic way to manage AWS EC2 instances. If you are performing repetitive tasks on multiple instances then using the CLI is a better way to manage. All these commands assume you have the necessary permissions to run. This is some more common CLI examples: …
We have several different environments hosted in different Amazon accounts so need to create IAM accounts for each. So switching between different IAM accounts is very useful. The AWS CLI allows you to store different profiles. If you haven’t installed the CLI already, then follow Amazon’s guide here. Configuring Multiple …
The Amazon Elastic Block Store (Amazon EBS) offers persistent storage for Amazon EC2 instances through EBS volumes. Amazon EBS provides the ability to create point-in-time consistent snapshots of the volumes, which are then stored in Amazon S3. These snapshots are also replicated across multiple Availability Zones automatically. Snapshots play an …
Office 365 doesn’t offer you a way to easily import a list of contacts into your company’s Global Address List (GAL). But it can be done quite easily with Powershell and a csv file of the contacts to import. First of all the csv file. There are some mandatory fields …
The default behavior for shared mailboxes is that the sent mail will go to the sent items folder of the senders mailbox. This means other users with shared access cannot see what has been sent from this mailbox. We can change this so the sent items are saved to the …