FriendsOfMDT / PSD

PowerShell Deployment
MIT License
525 stars 83 forks source link

Workgroup and Domain Join - Is this intended? #150

Open SBolt11 opened 6 months ago

SBolt11 commented 6 months ago

Good Morning,

When I was rifling through the scripts for MDT PSD, there was one part that stood out in the PSDConfigure.ps1 script.

Line 53 to 56, regarding domain join:

Fix issue if Domainjoin value is blank as well as joinworkgroup if($tsenv:JoinDomain -eq "" -or $tsenv:JoinDomain -eq $null){ $tsenv:JoinWorkgroup = "WORKGROUP" }

Should this not say that if($tsenv:JoinDomain -eq "" -or $tsenv:JoinDomain -eq $null -or $tsenv:JoinWorkgroup = "" -or $tsenv:JoinWorkgroup = $null){$tsenv:JoinWorkgroup = "WORKGROUP"}

?

E.g., if I put Workgroup value to be something other than Workgroup, I want it to stay as what I put, not go back to Workgroup.

Thanks,

SBolt11

PowerShellCrack commented 6 months ago

That is a good point. I can see this probably wouldn't matter what you put into the Wizard for join Workgroup. I would expand it to further ensure it checks all prereqs for join domain properties.

# Check if domain variables are not null
# Fix issue if Domainjoin value is blank as well as joinworkgroup
if ([string]::IsNullOrEmpty($tsenv:JoinDomain) -or
    [string]::IsNullOrEmpty($tsenv:DomainAdmin) -or
    [string]::IsNullOrEmpty($tsenv:DomainAdminDomain) -or
    [string]::IsNullOrEmpty($tsenv:DomainAdminPassword)) {
    # If $tsenv:JoinWorkGroup is not null or empty, set it to WORKGROUP
    if ([string]::IsNullOrEmpty($tsenv:JoinWorkGroup)) {
        $tsenv:JoinWorkGroup = "WORKGROUP"
    }
}
SBolt11 commented 6 months ago

Thanks @PowerShellCrack that looks good. I just wanted to point it out as I noticed and it might help others.

PowerShellCrack commented 6 months ago

right. I will mention it to the team and see if we can get it changed in the next release. I may use -and instead of -or though

GeoSimos commented 5 months ago

@PowerShellCrack can we close this issue?

PowerShellCrack commented 5 months ago

I added this to the updated PSD development code, but it is still under review.

SBolt11 commented 5 months ago

Thanks both, sorry to leave you an issue to review. From my side, feel free to close, we all know what it's like having a long list! For what it's worth, what you have all made is brilliant, I just hope the little pokes here and there by the community make it better overall :-)

PowerShellCrack commented 5 months ago

IMO, I would keep it open for tracking; I think this is a valid issue. And we appreciate the contributions from the community; this is why this project has been so great is because of all of you!

PowerShellCrack commented 2 months ago

@SBolt11 Please test the new release of PSD and send feedback as this has been added.