search for: ldbdb

Displaying 19 results from an estimated 19 matches for "ldbdb".

2017 Feb 09
3
Users list and the date the password will expire
...' | awk -F ':' '{print $NF}' | sed 's/^ *//g') > if [ -z "${LDBDIR}" ]; then > echo "This is supposed to be a DC, but cannot obtain the Private dir." > echo "Cannot Continue...Exiting." > exit 1 > else > LDBDB="${LDBDIR}/sam.ldb" > fi > > # Get the default naming context of the domain # DC=samdom,DC=example,DC=com > domainDN=$(ldbsearch -H "${LDBDB}" -b "" -s base defaultNamingContext | grep 'defaultNamingContext' | sed 's|defaultNamingContext: ||'...
2017 Feb 08
4
Users list and the date the password will expire
Hi list, long time no see! :) I was looking for an email reminder script for users whose password will expire. Some of our users are on long travels and will never see the Domain's default notification. I haven't found any complete (and simple) solution online. So I wrote one. In case it helps anyone, you find it below. You should only have to fill in the blanks for the the
2017 Feb 09
0
Users list and the date the password will expire
...$(samba -b | grep 'PRIVATE_DIR' | awk -F ':' '{print $NF}' | sed 's/^ *//g') if [ -z "${LDBDIR}" ]; then echo "This is supposed to be a DC, but cannot obtain the Private dir." echo "Cannot Continue...Exiting." exit 1 else LDBDB="${LDBDIR}/sam.ldb" fi # Get the default naming context of the domain # DC=samdom,DC=example,DC=com domainDN=$(ldbsearch -H "${LDBDB}" -b "" -s base defaultNamingContext | grep 'defaultNamingContext' | sed 's|defaultNamingContext: ||') if [ -z "${...
2017 Feb 09
0
Users list and the date the password will expire
...#39; | >> sed 's/^ *//g') >> if [ -z "${LDBDIR}" ]; then >> echo "This is supposed to be a DC, but cannot obtain the Private >> dir." >> echo "Cannot Continue...Exiting." >> exit 1 >> else >> LDBDB="${LDBDIR}/sam.ldb" >> fi >> >> # Get the default naming context of the domain # >> DC=samdom,DC=example,DC=com >> domainDN=$(ldbsearch -H "${LDBDB}" -b "" -s base defaultNamingContext >> | grep 'defaultNamingContext' | sed...
2017 Feb 09
5
Users list and the date the password will expire
On Thu, 9 Feb 2017 12:49:12 +0100 Ole Traupe via samba <samba at lists.samba.org> wrote: > Never mind. However, with your update I get the following error right > on the first found "user": > > ./mailtest_rowland.sh: line 27: (""/10000000)-11644473600: syntax > error: operand expected (error token is """/10000000)-11644473600") >
2015 Apr 09
2
samba member logon.. question.
...first free uidNumber or gidNumber > _findnext () { > ATTR="$1" > if [ -z "${ATTR}" ]; then > error "No Attribute supplied" > error "Cannot continue... Exiting." > exit 1 > fi > _NEXTID=$(ldbsearch -H ${LDBDB} -b > "CN=${domainNETBios},CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System,${domainDN}" > -s sub '(objectClass=msSFU30DomainInfo)' ${ATTR} | grep "${ATTR}: " | > awk '{print $NF}') > if [ -z "$_NEXTID" ] || [ "$_NEXTID" -lt...
2015 Apr 09
3
samba member logon.. question.
El 09/04/15 a les 16:20, Rowland Penny ha escrit: > On 09/04/15 14:58, Luca Olivetti wrote: >> El 09/04/15 a les 14:57, Andrey Repin ha escrit: >>>> Using the RFC2307 attributes, you will get the same ID number on every >>>> Unix machine, whereas if you use the 'rid' backend, whilst you should >>>> get the same ID on each Unix machine, you will
2015 Apr 09
3
samba member logon.. question.
...> ATTR="$1" >>> if [ -z "${ATTR}" ]; then >>> error "No Attribute supplied" >>> error "Cannot continue... Exiting." >>> exit 1 >>> fi >>> _NEXTID=$(ldbsearch -H ${LDBDB} -b >>> "CN=${domainNETBios},CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System,${domainDN}" >>> -s sub '(objectClass=msSFU30DomainInfo)' ${ATTR} | grep "${ATTR}: " | >>> awk '{print $NF}') >>> if [ -z "$_NEXTID" ]...
2015 Apr 09
0
samba member logon.. question.
...er or msSFU30MaxGidNumber # Output : the first free uidNumber or gidNumber _findnext () { ATTR="$1" if [ -z "${ATTR}" ]; then error "No Attribute supplied" error "Cannot continue... Exiting." exit 1 fi _NEXTID=$(ldbsearch -H ${LDBDB} -b "CN=${domainNETBios},CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System,${domainDN}" -s sub '(objectClass=msSFU30DomainInfo)' ${ATTR} | grep "${ATTR}: " | awk '{print $NF}') if [ -z "$_NEXTID" ] || [ "$_NEXTID" -lt "10000" ]...
2015 Apr 09
0
samba member logon.. question.
...> _findnext () { >> ATTR="$1" >> if [ -z "${ATTR}" ]; then >> error "No Attribute supplied" >> error "Cannot continue... Exiting." >> exit 1 >> fi >> _NEXTID=$(ldbsearch -H ${LDBDB} -b >> "CN=${domainNETBios},CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System,${domainDN}" >> -s sub '(objectClass=msSFU30DomainInfo)' ${ATTR} | grep "${ATTR}: " | >> awk '{print $NF}') >> if [ -z "$_NEXTID" ] || [ "$_NE...
2015 Apr 09
0
samba member logon.. question.
...gt;>>> if [ -z "${ATTR}" ]; then >>>> error "No Attribute supplied" >>>> error "Cannot continue... Exiting." >>>> exit 1 >>>> fi >>>> _NEXTID=$(ldbsearch -H ${LDBDB} -b >>>> "CN=${domainNETBios},CN=ypservers,CN=ypServ30,CN=RpcServices,CN=System,${domainDN}" >>>> -s sub '(objectClass=msSFU30DomainInfo)' ${ATTR} | grep "${ATTR}: " | >>>> awk '{print $NF}') >>>> if [ -z &quot...
2018 May 29
2
Scripting the next UID/GID number to use
Hello,     I'm developing a script to create a user and pass along all the necessary unix attributes required. I'm successful except when I go to increment msSFU30MaxUidNumber or msSFU30MaxGidNumber. I'm not sure how to use ldbedit to script this process. Any guidance would be great. Thanks. - James
2019 Aug 20
3
winbind on DC : how use gidNumber instead of primaryGroupID as user's primary group
...051s user 0m0.002s sys 0m0.005s time /usr/bin/id username |/usr/bin/awk -F"=" '{ print $2 }'|/usr/bin/cut -d"(" -f1 10002 real 0m0.050s user 0m0.007s sys 0m0.000s So with or without path does not make much of a difference.. SAMBA_BIN=$(which samba) LDBDB="$(${SAMBA_BIN} -b | grep PRIVATE_DIR |sed 's/\ //g' | awk -F":" {'print $2'})/sam.ldb" DN="$(ldbsearch -H "${LDBDB}" -b "" -s base defaultNamingContext | grep 'defaultNamingContext' | sed 's|defaultNamingContext: ||')&quo...
2019 Aug 19
3
winbind on DC : how use gidNumber instead of primaryGroupID as user's primary group
Le lun. 19 ao?t 2019 ? 11:01, L.P.H. van Belle via samba <samba at lists.samba.org> a ?crit : > > Hai, > > Fist of all, i must say it not very wise to have you NFS server on the AD-DC. > > I do about the same but my NFS server is on a member. > > Have you configured /etc/nsswitch.conf ? > If not do that. > > If you run : id username > I see :
2017 Feb 09
0
Users list and the date the password will expire
Actually, there were 2 problems. These lines work for me: #user=$(echo "${user}" | awk -F '\\' '{print $2}') user_expire_date=$(ldbsearch --url="${LDBDB}" -b "${domainDN}" -s sub "(&(objectCategory=person)(objectClass=user)(sAMAccountName=$user))" msDS-UserPasswordExpiryTimeComputed | grep "msDS-UserPasswordExpiryTimeComputed: " | sed "s|msDS-UserPasswordExpiryTimeComputed: ||") UNIXTimeStam...
2017 Feb 13
2
Users list and the date the password will expire
Quick addendum: I just stumbled upon abandoned accounts receiving "password expired" notifications forever, even if they get disabled subsequently (by me). It might be helpful to include this in the script: uAC_string=$(ldbsearch --url="${LDBDB}" -b "${domainDN}" -s sub "(&(objectCategory=person)(objectClass=user)(sAMAccountName=$user))" userAccountControl | grep userAccountControl: | sed "s|userAccountControl: ||") if [ "${uAC_string}" -eq "512" ]; then [do expiration...
2017 Feb 09
2
Users list and the date the password will expire
...tOS 6.7 DC with Samba version 4.2.5. Ole On 09.02.2017 13:40, Ole Traupe via samba wrote: > Actually, there were 2 problems. These lines work for me: > > #user=$(echo "${user}" | awk -F '\\' '{print $2}') > user_expire_date=$(ldbsearch --url="${LDBDB}" -b "${domainDN}" -s > sub > "(&(objectCategory=person)(objectClass=user)(sAMAccountName=$user))" > msDS-UserPasswordExpiryTimeComputed | grep > "msDS-UserPasswordExpiryTimeComputed: " | sed > "s|msDS-UserPasswordExpiryTimeComputed: |...
2017 Feb 09
2
Users list and the date the password will expire
On Thu, 9 Feb 2017 14:56:47 +0100 Ole Traupe via samba <samba at lists.samba.org> wrote: > I only get the usernames: > Same on member servers, btw. Initially I thought this comes from > "winbind: use default domain", but this is neither present on my DCs > nor would it have any effect (afaik). This is what is confusing me, I know of no way to get the username
2018 May 29
4
Scripting the next UID/GID number to use
...on one DC, but sadly not across the whole domain, which is why it isn't part of our standard feature-set (we don't like to create tools that have inherent races). That just means always run this against one specific DC to be safe. > echo "${newid}" | $LDBMODIFYBIN -H "$ldbdb" > /dev/null 2>&1 > if [ $? != 0 ]; then > echo "Error updating $1 in AD." > exit 1 > fi > > echo "Successfully updated $1 in AD" > } > > Rowland I hope this helps, Andrew Bartlett -- Andrew Bartlett h...