PSD icon indicating copy to clipboard operation
PSD copied to clipboard

Workgroup and Domain Join - Is this intended?

Open SBolt11 opened this issue 1 year ago • 8 comments

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

SBolt11 avatar May 07 '24 11:05 SBolt11

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"
    }
}

PowerShellCrack avatar May 08 '24 00:05 PowerShellCrack

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

SBolt11 avatar May 08 '24 07:05 SBolt11

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

PowerShellCrack avatar May 08 '24 15:05 PowerShellCrack

@PowerShellCrack can we close this issue?

GeoSimos avatar May 28 '24 19:05 GeoSimos

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

PowerShellCrack avatar May 28 '24 19:05 PowerShellCrack

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 :-)

SBolt11 avatar May 29 '24 06:05 SBolt11

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 avatar May 29 '24 14:05 PowerShellCrack

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

PowerShellCrack avatar Sep 16 '24 00:09 PowerShellCrack