Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi this program will tell me if an user account is part of the Active Directory group. I am trying to get this to loop

Hi this program will tell me if an user account is part of the Active Directory group. I am trying to get this to loop with a response of yes or no. But it is not looping and I'm not sure how to fix it.

Thank you.

image text in transcribed

image text in transcribed

#INITIALIZATION #Enter variable for user 1 Seny: USERNAME #FUNCTION #This section contains the function to display member Get-ADUser-Identity khines #MAIN BODY #If the member is part of the AD group, return yes, if not, return no $env:USERNAME = $true #If ($env: username) {} Write-Host "Yes" #else ($env: username) write-Host "No" $env: USERNAME -$true Do { "Starting loop $env: USERNAME" Senv:USERNAME =$true $env:USERNAME } while ($env: USERNAME =khines) #INITIALIZATION #Enter variable for user1 Senv: USERNAME - #FUNCTION #This section contains the function to display member Get-ADUser -Identity khines #MAIN BODY #If the member is part of the AD group, return yes, if not, return no Senv: USERNAME= Strue #If ($env: username) Write-Host "Yes" #else (Seny: username) Write-Host "No" Seny: USERNAME =Strue Do { "Starting loop Seny: USERNAME" Senv: USERNAME=Strue Senv: USERNAME } while (Seny: USERNAME =khines) #INITIALIZATION #Enter variable for user 1 Seny: USERNAME #FUNCTION #This section contains the function to display member Get-ADUser-Identity khines #MAIN BODY #If the member is part of the AD group, return yes, if not, return no $env:USERNAME = $true #If ($env: username) {} Write-Host "Yes" #else ($env: username) write-Host "No" $env: USERNAME -$true Do { "Starting loop $env: USERNAME" Senv:USERNAME =$true $env:USERNAME } while ($env: USERNAME =khines) #INITIALIZATION #Enter variable for user1 Senv: USERNAME - #FUNCTION #This section contains the function to display member Get-ADUser -Identity khines #MAIN BODY #If the member is part of the AD group, return yes, if not, return no Senv: USERNAME= Strue #If ($env: username) Write-Host "Yes" #else (Seny: username) Write-Host "No" Seny: USERNAME =Strue Do { "Starting loop Seny: USERNAME" Senv: USERNAME=Strue Senv: USERNAME } while (Seny: USERNAME =khines)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions