0

i am quite new to python ...
currently i am a student learning for mu mcitp exams..

i made a small script ,, for active directory using python

all the script does is basicly explor the AD for a number of tasks ..

* 1 .Find a user (quick method)
* 2 .Find a computer (quick method)
* 3 .List all users
* 4 .List users in an OU
* 5 .List all groups
* 6 .Show the members of a group
* 7 .Show the types of a group
* 8 .List the groups a user is in

i have used the AD moudle for this script ..

my question is this i have the follwing code :

# find user (
elif choice == "1":
import active_directory
user = active_directory.find_user ("shay")
print user

how can i make the entry for the "user" (in this case "shay"
shift according to raw input from the user

i need the ability to replace the name
how can i accomplise this ?

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by shiva666
0
# find user (
elif choice == "1":
import active_directory
user_name = raw_input('Enter user name: ")
user = active_directory.find_user (user_name)
print user

You might also want to do some input checking and/or check that the find_user function returns a valid user.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.