I&#39;m trying to set the values for TerminalServicesHomeDrive and TerminalServicesHomeDirectory through Python.<br><br>I have this code that works in Powershell but need to get the same functionality in python. It looks like <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa380823%28v=vs.85%29.aspx">IADsTSUserEx </a>object owns those permissions but how would I access that object.<br>
<br>#Powershell code that works<br>&lt;code&gt;<br>$TSHomeDrive = &#39;I:&#39;<br>$TSHomeDirectory = &#39;\\myserver\homehomedrive$\&#39;<br>$aduser = [adsi] $ldapstr<br>$aduser.TerminalServicesHomeDirectory = $TSHomeDirectory+$aduser.samaccountname<br>
$aduser.TerminalServicesHomeDrive = $TSHomeDrive<br>$aduser.setinfo()<br>&lt;/code&gt;<br><br>I&#39;ve tried these below but get property not found errors:<br><br>#Python code that doesn&#39;t work<br>&lt;code&gt;<br>import active_directory as ad<br>
<br>aduser = ad.find_user()<br>aduser.TerminalServicesHomeDirectory #fails with attribute error<br>aduser.com_object.TerminalServicesHomeDirectory #fails with attribute error<br><br>#as you would expect, these fail too, with attribute not found errors<br>
aduser.com_object.Put(&#39;TerminalServicesHomeDirectory&#39;, tdhdir)<br>aduser.com_object.SetInfo()<br>&lt;/code&gt;<br>
<br>Any thoughts how I could modify those attributes via Python?<br><br>Thanks in advance,<br><br>Daniel Scoggins<br>