From a QAS client is it possible to find the highest used gidNumber or uidNumber in the AD domain?
The following query will help you in finding the biggest used uid/gidNumber in the domain.
# /opt/quest/bin/vastool -u host/ search -q "(&(ObjectCategory=Group)(gidNumber=*))" gidNumber | sort -n | uniq | tail -1
# /opt/quest/bin/vastool -u host/ search -q "(&(ObjectCategory=User)(uidNumber=*))" uidNumber | sort -n | uniq | tail -1
You will need to increment it by 1 to allocate to the group/user in your script.