AdsiPS icon indicating copy to clipboard operation
AdsiPS copied to clipboard

Assumptive Nature - New-ADSIDirectoryContext

Open jakedenyer-s24 opened this issue 7 years ago • 2 comments

This is more of a suggestion that an issue.

I suggest removing the assumptive nature of the Forest and Domain Parameters using :

	[Parameter(ParameterSetName = 'Domain')]
	$DomainName = [System.DirectoryServices.ActiveDirectory.Domain]::Getcurrentdomain(),
	
	[Parameter(ParameterSetName = 'Forest')]
	$ForestName = [System.DirectoryServices.ActiveDirectory.Forest]::Getcurrentforest(),

This caused an issue when I was running the commands from a non-domain joined system. Even when I was providing the Parameters with my own values they would still fail - The only fix I was able to come up with was removing these default values.

jakedenyer-s24 avatar Mar 29 '18 18:03 jakedenyer-s24

Thanks @jakedenyer-s24 for the feedback!

lazywinadmin avatar Mar 29 '18 23:03 lazywinadmin

No Problem!

Also this has been a huge help to me. My use case is probably in the minority - most people will probably be on a domain while using this.

Apparently I need to learn how to use GitHub.. Reopening.

jakedenyer-s24 avatar Mar 30 '18 02:03 jakedenyer-s24