File tree Expand file tree Collapse file tree 1 file changed +0
-35
lines changed
Expand file tree Collapse file tree 1 file changed +0
-35
lines changed Original file line number Diff line number Diff 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-
940905Creates a powershell session with the JeaComputer for registration actions
941906
942907#>
You can’t perform that action at this time.
0 commit comments