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

In some situations, it is necessary to use credentials for getting the Domain Controller using the DetectDC parameter. #77

Merged
merged 6 commits into from
Dec 17, 2022

Conversation

ferwe
Copy link
Contributor

@ferwe ferwe commented Dec 12, 2022

Find-Events via remoting doesn't work always.
In some situations, it is necessary to use credentials for getting the Domain Controller using the DetectDC parameter.

Added Credentials to all necessary functions

Added Credential to Get-ServerList if parameter credential is set
Added Credential to Get-ServerListLimited
Added Credential to Get-ServersList function
Removed Credential from Get-ServersListLimited
Refactor - Code Design
@@ -30,7 +31,11 @@ function Get-ServersList {
}
if ($Target.DomainControllers.Enabled) {
if (-not $Quiet) { $Logger.AddInfoRecord("Preparing servers list - domain controllers autodetection") }
[Array] $Servers = (Get-WinADDomainControllers -SkipEmpty).HostName
if($Credential) {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it always true? Since you set it to Empty by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right.
I will fix this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok fixed.

@PrzemyslawKlys PrzemyslawKlys merged commit 96835a9 into EvotecIT:master Dec 17, 2022
@PrzemyslawKlys PrzemyslawKlys changed the title Ferwe patch 1 - In some situations, it is necessary to use credentials for getting the Domain Controller using the DetectDC parameter. Dec 18, 2022
@PrzemyslawKlys PrzemyslawKlys changed the title - In some situations, it is necessary to use credentials for getting the Domain Controller using the DetectDC parameter. In some situations, it is necessary to use credentials for getting the Domain Controller using the DetectDC parameter. Dec 18, 2022
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