Skip to content

Commit 9e2617b

Browse files
author
brbartle
authored
Merge pull request #323 from slinehan/vnext
Removed the check for DomainAdmin
2 parents ad546bf + 6f96197 commit 9e2617b

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

Registration/RegisterWithAzure.psm1

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,6 @@ function RegistrationWorker{
570570
# Pre-registration setup
571571
#
572572

573-
Resolve-DomainAdminStatus -Verbose
574573
Log-Output "Logging in to Azure."
575574
$connection = Connect-AzureAccount -SubscriptionId $AzureSubscriptionId -AzureEnvironment $AzureEnvironmentName -AzureDirectoryTenantName $AzureDirectoryTenantName -Verbose
576575
$session = Initialize-PrivilegedJeaSession -JeaComputerName $JeaComputerName -CloudAdminCredential $CloudAdminCredential -Verbose
@@ -903,40 +902,6 @@ function Connect-AzureAccount{
903902
904903
.SYNOPSIS
905904
906-
Determines if the currently running user is part of the Domain Admin's group
907-
908-
#>
909-
function Resolve-DomainAdminStatus{
910-
[CmdletBinding()]
911-
Param()
912-
try
913-
{
914-
Log-Output "Checking for user logged in as Domain Admin"
915-
$currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
916-
$windowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($CurrentUser)
917-
$domain = Get-ADDomain
918-
$sid = "$($domain.DomainSID)-512"
919-
920-
if($windowsPrincipal.IsInRole($sid))
921-
{
922-
Log-Output "Domain Admin check : ok"
923-
}
924-
}
925-
catch [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException]
926-
{
927-
$message = "User is not logged in as a domain admin. registration has been cancelled."
928-
Log-Throw -Message "$message `r`n$($_.Exception)" -CallingFunction $PSCmdlet.MyInvocation.InvocationName
929-
}
930-
catch
931-
{
932-
Log-Throw -Message "Unexpected error while checking for domain admin: `r`n$($_.Exception)" -CallingFunction $PSCmdlet.MyInvocation.InvocationName
933-
}
934-
}
935-
936-
<#
937-
938-
.SYNOPSIS
939-
940905
Creates a powershell session with the JeaComputer for registration actions
941906
942907
#>

0 commit comments

Comments
 (0)