Skip to content

Commit cd9a9d1

Browse files
committed
delete
1 parent 9e6893d commit cd9a9d1

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ ln -s $PWD/lib/ad_utils.py $INSTALL/lib/ad_utils.py
2626
ln -s $PWD/bin/changepwd.py $INSTALL/bin/changepwd.py
2727
ln -s $PWD/bin/ping.py $INSTALL/bin/ping.py
2828
ln -s $PWD/bin/resetpwd.py $INSTALL/bin/resetpwd.py
29+
ln -s $PWD/bin/delentity.py $INSTALL/bin/delentity.py
2930
ln -s $PWD/bin/upsertidentity.py $INSTALL/bin/upsertidentity.py
3031
chmod 700 $INSTALL/bin/*
3132
mkdir $INSTALL/ps1_templates

src/bin/delentity.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/python3 -u
2+
import sys
3+
sys.path.append('../lib')
4+
import ad_utils as ad
5+
import backend_utils as u
6+
import argparse
7+
8+
parser = argparse.ArgumentParser()
9+
parser.add_argument('--debug', help='Debug mode', default="")
10+
args = parser.parse_args()
11+
12+
if args.debug == "1" :
13+
ad.__DEBUG__=1
14+
15+
entity=u.readjsoninput()
16+
config=u.read_config('../etc/config.conf')
17+
ad.set_config(config)
18+
if u.is_backend_concerned(entity):
19+
ad.ad_exec_script(entity,'delentity.template')
20+
else:
21+
u.returcode(0,"not concerned")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
try{
2+
Remove-ADUser -Identity {{ e.uid }}
3+
Write-Host "user deleted"
4+
}catch{
5+
Write-Host $_
6+
exit 1
7+
}

0 commit comments

Comments
 (0)