#!/bin/bash
#This script assumes that the cluster is in a domain and the node running the script
#has access to a valid Active Directory Server
#Originally written for OneFS 5.5.4 and 5.5.6
#Modified to support OneFS 6.5, Jan 2013 RK
#Script currently does not support removing deleted accounts
#User Set Variables
#uidadvance - This is the number that the cluster will advance the UID over the last
#set of digits in the SID field
uidadvance=10000
#guiadvance - This is the number that the cluster will advance the GID over the last
#set of digits in the SID field
gidadvance=10000
#path - Sets the path that the comparison files will be located in. If the
#current.mapped.accounts.txt file has been removed the cluster will assume that
#all accounts must be remapped. If individual accounts are removed from that file
#only those accounts will be remapped.
path='/ifs/data/compare'
domain=‘YOURDOMAINSHORTNAME'
#timestamp for log
date
#Cluster Set Variables
#Checking for the base file and path
if [ -d "$path" ]
then
clearcache=0
if ! [ -f "$path/current.mapped.user.accounts.txt" ]
then
echo "No currently mapped user accounts, remapping all user accounts"
touch $path/current.mapped.user.accounts.txt
clearcache=1
fi
if ! [ -f "$path/current.mapped.group.accounts.txt" ]
then
echo "No currently mapped group accounts, remapping all group accounts"
touch $path/current.mapped.group.accounts.txt
clearcache=1
fi
#Creating the current user and group list
isi auth ads user list > $path/new.user.list.txt
isi auth ads group list > $path/new.group.list.txt
#User Comparison and mapping Script
diff -f $path/current.mapped.user.accounts.txt $path/new.user.list.txt | grep -i $domain | awk -F \\ '{print $2}' | while read line
do
variable="$domain\\$line"
sourcesid=`isi auth ads users list -v --name="$variable" | fgrep Sid: | awk '{print $2}'`
# remove all but the last part of SID, then add base UID
targetuid=$((${sourcesid##*-} + $uidadvance))
if [ $uidadvance -ne $targetuid ]
then
isi auth mapping modify --source-sid="$sourcesid" --target-uid="$targetuid" --2way --replace
echo $variable
fi
done
cp $path/new.user.list.txt $path/current.mapped.user.accounts.txt
#Group Comparison and mapping Script
diff -f $path/current.mapped.group.accounts.txt $path/new.group.list.txt | grep -i $domain | awk -F \\ '{print $2}' | while read line
do
variable="$domain\\$line"
sourcesid=`isi auth ads groups list -v --name="$variable" | fgrep Sid: | awk '{print $2}'`
# remove all but the last part of SID, then add base GID
targetgid=$((${sourcesid##*-} + $gidadvance))
if [ $gidadvance -ne $targetgid ]
then
isi auth mapping modify --source-sid="$sourcesid" --target-gid="$targetgid" --2way --replace
echo $variable
fi
done
cp $path/new.group.list.txt $path/current.mapped.group.accounts.txt
#Clearing the AD cache if neccessary
if [ $clearcache -eq 1 ]
then
isi_for_array -s 'lw-ad-cache --delete-all'
fi
else
echo "Path cannot be found, please create $path or set new script path"
fi--
You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isilon-user-gr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Isilon Technical User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/isilon-user-group/WPtdmxfHlQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to isilon-user-gr...@googlegroups.com.
I opened an SR on this topic (RID-based ID mapping) last year, and it came to no conclusion at all.No solution was offered other than populating our AD with POSIX attributes.
Our AD does already have the required schema change, and it's likely that we'll approach the issue by writing our own script to populate AD with POSIX UIDs and GIDs as calculated by SSSD (in our case)/winbind.We'll also be populating shell and home directory properties for users, though I found this had an interesting side effect when I tested it on our Isilon.If I login to the Isilon as my AD user, the shell is started in my standard home directory, /home/AD/johnb, which doesn't exist on the Isilon, of course. I then don't get any Bash config, so end up not in a home directory with no useful command prompt etc. Not ideal...is there a solution to this to override the AD-specified home directory on the Isilon cluster for administrators?
John
On Friday, 6 February 2015 17:14:21 UTC, Daniel Pritts wrote:I opened an SR on this topic (RID-based ID mapping) last year, and it came to no conclusion at all.No solution was offered other than populating our AD with POSIX attributes.
Just for the record, you don't have to only populate AD with the required posix attributes - you need to do so with AD's Services For Unix extension.
Just adding the appropriate attributes to the user and group objects does not work. They are ignored. Unfortunately.
danno
--
Dan Pritts
ICPSR Computing & Network Services
University of Michigan
+1 (734)615-7362
--
You received this message because you are subscribed to the Google Groups "Isilon Technical User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isilon-user-gr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.