<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Logon Script Archives - Vavai&#039;s Personal Notes</title>
	<atom:link href="https://vavai.net/tag/logon-script/feed/" rel="self" type="application/rss+xml" />
	<link>https://vavai.net/tag/logon-script/</link>
	<description>Life is our precious gift</description>
	<lastBuildDate>Fri, 01 Jan 2010 12:40:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Logon Script by Group Member on Samba PDC + OpenLDAP</title>
		<link>https://vavai.net/logon-script-by-group-member-on-samba-pdc-openldap/</link>
					<comments>https://vavai.net/logon-script-by-group-member-on-samba-pdc-openldap/#comments</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Fri, 01 Jan 2010 12:40:44 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Logon Script]]></category>
		<category><![CDATA[PDC]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[SUSE Family]]></category>
		<guid isPermaLink="false">http://v2.vavai.net/?p=917</guid>

					<description><![CDATA[<p>On the mixed environment between Linux and Windows, sometimes we need to setup a Windows client Mapping Folder with the group member permission. Actually what is the logon script by group member used for ? Logon script are a set of script, used for mapping folder or printer or to run certain application. It can...</p>
<p>The post <a href="https://vavai.net/logon-script-by-group-member-on-samba-pdc-openldap/">Logon Script by Group Member on Samba PDC + OpenLDAP</a> appeared first on <a href="https://vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://54.254.121.108/wp-content/uploads/2010/01/windows-linux2.jpg"><img fetchpriority="high" decoding="async" class="alignleft size-full wp-image-921" style="margin: 5px;" title="windows-linux" src="http://54.254.121.108/wp-content/uploads/2010/01/windows-linux2.jpg" alt="" width="400" height="232" /></a>On the mixed environment between Linux and Windows, sometimes we need to setup a Windows client Mapping Folder with the group member permission. Actually what is the logon script by group member used for ?<br />
Logon script are a set of script, used for mapping folder or printer or to run certain application. It can be execute based on user name, group membership or without any permission and applicable for all user.Â  Samba used a %u on the smb.conf configuration for user name permission membership and %g for group permission membership.<br />
Setting up the mapping folder with Samba file server may need a few configuration changes but how if we need to make it on Samba PDC + OpenLDAP ? I found this problem while configuring Samba PDC + OpenLDAP on the mixed environment on a Windows-Linux migration project. The client-a company located at Jakarta-need a group membership permission to simplify their folder &amp; printer mapping for each workstation, because all users divided into some department and each department has similar permissions<br />
Below are the solution, using Samba PDC+OpenLDAP and Windows 2000 or Windows 2003 Resource Kit application : ifmember.</p>
<ol>
<li>Prepare a group entry for OpenLDAP database. Below is an example ldif file. I&#8217;m using vavai.ldif as ldif file name, don&#8217;t forget to adjust the SambaSID, domain name and group name with your setting. Accounting is an example group name, I used the last gid number as defined gid number<br />
[code language=&#8217;cpp&#8217;]<br />
dn: cn=accounting,ou=Groups,dc=vavai,dc=com<br />
objectClass: posixGroup<br />
objectClass: sambaGroupMapping<br />
gidNumber: 517<br />
cn: accounting<br />
sambaSID: S-1-5-21-4205329590-3768540535-3414456912-517<br />
sambaGroupType: 2<br />
displayName: accounting<br />
description: accounting<br />
[/code]<br />
If you would prefer to use smbldap tools, the above ldif file same as the command below<br />
[code language=&#8217;cpp&#8217;]<br />
smbldap-groupadd -a accounting<br />
[/code]</li>
<li>Import the ldif file into OpenLDAP database<br />
[code language=&#8217;cpp&#8217;]<br />
slapadd -v -l vavai.ldif -f /etc/openldap/slapd.conf<br />
[/code]</li>
<li>Create a user and join to the group<br />
[code language=&#8217;cpp&#8217;]<br />
smbldap-useradd -a -m vavai<br />
smbldap-passwd vavai<br />
smbldap-groupmod -m vavai accounting<br />
[/code]</li>
<li>Change the smb.conf configuration, on the logon script field as below :<br />
[code language=&#8217;cpp&#8217;]<br />
logon script = logon.bat<br />
[/code]</li>
<li>Check your share configuration where your logon script should be reside<br />
[code language=&#8217;cpp&#8217;]<br />
[netlogon]<br />
comment = Network Logon Service<br />
path = /data/samba/sysvol/vavai.com/scripts<br />
writeable = yes<br />
browseable = yes<br />
read only = no<br />
[/code]<br />
The above configuration means that I must placed the logon script at theÂ <strong>/data/samba/sysvol/vavai.com/scripts </strong>folder</li>
<li>Download <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=07c2f6d7-815e-4fa0-9043-4e4635ccd417&amp;DisplayLang=en">Windows Resource Kit ifmember.exe</a>, install it on each Windows client (or placed it on a share folder so we can access it without copying the executable file in each client)</li>
<li>Create your logon.bat, something like a script as below Â :<br />
[code language=&#8217;cpp&#8217;]<br />
echo Execute bat file&#8230;<br />
ifmember.exe &#8220;vavai.comaccounting&#8221;<br />
if errorlevel 1 call accounting.bat<br />
ifmember.exe &#8220;vavai.compurchasing<br />
if errorlevel 1 call purchasing.bat<br />
ifmember.exe &#8220;vavai.comppic&#8221;<br />
if errorlevel 1 call ppic.bat<br />
[/code]</li>
<li>Don&#8217;t forget to create a Â group name.bat (as an example : accounting.bat) with your preferred script. My script will looks like below :<br />
[code language=&#8217;cpp&#8217;]<br />
echo Mapping Network Drives to Samba Server&#8230;<br />
net use s: \server-vavaiaccounting<br />
net use p: \server-vavaipublic<br />
net use o: \server-vavaihrd<br />
[/code]</li>
</ol>
<p>A long way to get a simple result ? If you have better solution, please share it on the comment form <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> . Anyway, the above script solved my problem successfully.</p>
<p>The post <a href="https://vavai.net/logon-script-by-group-member-on-samba-pdc-openldap/">Logon Script by Group Member on Samba PDC + OpenLDAP</a> appeared first on <a href="https://vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://vavai.net/logon-script-by-group-member-on-samba-pdc-openldap/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 5/63 objects using Disk
Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: d3b35uem336dgh.cloudfront.net
Lazy Loading (feed)
Minified using Disk
Database Caching 14/44 queries in 0.025 seconds using Disk

Served from: vavai.net @ 2026-11-13 02:37:51 by W3 Total Cache
-->