Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Backup-GroupPolicy.ps1 #3

Merged
merged 1 commit into from
Oct 16, 2019
Merged

Update Backup-GroupPolicy.ps1 #3

merged 1 commit into from
Oct 16, 2019

Conversation

SamErde
Copy link
Contributor

@SamErde SamErde commented Oct 15, 2019

  1. Replaced WMI query for the domain name with a reference to the system environment variable for the current user's domain. Avoids the expense of running a WMI query.
  2. Removed the Mandatory attribute from the Server parameter. This was missing a Boolean setting, and compensating code is added below.
  3. Since your blog post mentioned thoughts around using "Server" vs "DomainController" or "DC" for the parameter name, I though you might like an alias for this!
  4. Added tab autocomplete for the server parameter, which fills in domain controller names automatically! Lines
  5. Gets a domain controller name for the Server parameter if no server parameter is specified.
  6. Checks to see if $UpdatePath does not exist, creates the new backup folder if it does not exist yet. No errors now if the folder already exists. My goal is to be able to run this multiple times per day, if necessary.
  7. Grammar police removed the apostrophe from "GPOs"

1. Replaced WMI query for the domain name with a reference to the system environment variable for the current user's domain. Avoids the expense of running a WMI query.
2. Removed the Mandatory attribute from the Server parameter. This was missing a Boolean setting, and compensating code is added below.
3. Since your blog post mentioned thoughts around using "Server" vs "DomainController" or "DC" for the parameter name, I though you might like an alias for this!
4. Added tab autocomplete for the server parameter, which fills in domain controller names automatically! Lines
5. Gets a domain controller name for the Server parameter if no server parameter is specified.
6. Checks to see if $UpdatePath does not exist, creates the new backup folder if it does not exist yet. No errors now if the folder already exists. My goal is to be able to run this multiple times per day, if necessary.
7. Grammar police removed the apostrophe from "GPOs"
$Domain = (Get-WmiObject Win32_ComputerSystem).Domain,

[Parameter()]
[string]
$Domain = $env:USERDNSDOMAIN,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will pull the current domain from the system environment variables instead of processing a WMI query.

Copy link
Owner

@compwiz32 compwiz32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the code adds!

@compwiz32 compwiz32 merged commit 059c7a1 into compwiz32:master Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants