<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Hello,</div><div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif">Would appreciate any help regarding my problem. </font></div>

<div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif"><br></font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif">Problem: <br></font><div>I am currently on a project for back up server with python script.</div>

<div>The project is actually arise from problem whereby when I need to back up my server (Windows Server 2003), I usually use Robocopy but, when I copy the folders from server 1 to server 2, it doesn't copy the user and group access as well. Thus, I need to manually configure the users and groups permission for each of the folders. I decided to try Python scripting as part of the solution but I'm novice with Python and windows active directory as well. I'm not sure how to copy the users and groups in active directory. </div>

<div><br></div><div>I browse through the website and found python-win32, I would like to try it, but since I'm not familiar so I'm not sure how to get it done. So far, I only able to code the Python scripting on copying the folders. I hope that I can proceed with users permission as well.   </div>

<div><br></div><div>I am hoping for you knowledge & experienced and greatly appreciate any help. </div><div>Thanks. <br></div><div><div><br></div>Hi,</div><div>regarding the problem, I have try various Robocopy command with security but it doesn't work as what I wanted. I have found this website <a href="https://zakird.com/pyad/pyad.html">https://zakird.com/pyad/pyad.html</a> but I'm not really sure how should I code it since I'm not really familiar. What I would like to do is basically like this: </div>

<div>- connect to AD</div><div>- create AD object that holds the users and groups </div><div>- the object will loop through the list of users and groups in AD</div><div>- it will copy the users and groups permission. </div>

<div><br></div><div>I hope that anyone can help me. Thanks. </div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Jul 19, 2014 at 10:06 AM,  <span dir="ltr"><<a href="mailto:python-win32-request@python.org" target="_blank">python-win32-request@python.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send python-win32 mailing list submissions to<br>
        <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:python-win32-request@python.org">python-win32-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:python-win32-owner@python.org">python-win32-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of python-win32 digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Re: Problem passing array by reference (Tim Roberts)<br>
   2. Re: Problem passing array by reference (Marco Nawijn)<br>
   3. Re: Problem passing array by reference (Marco Nawijn)<br>
   4. PythonWin on linux under wine (Peter Fraser)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 18 Jul 2014 09:26:34 -0700<br>
From: Tim Roberts <<a href="mailto:timr@probo.com">timr@probo.com</a>><br>
To: "<a href="mailto:python-win32@python.org">python-win32@python.org</a>" <<a href="mailto:python-win32@python.org">python-win32@python.org</a>><br>
Subject: Re: [python-win32] Problem passing array by reference<br>
Message-ID: <<a href="mailto:53C94ABA.1020103@probo.com">53C94ABA.1020103@probo.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Marco Nawijn wrote:<br>
> An update on where I am at the moment. I managed to find the library that<br>
> holds the definition for the GetComponents call. When I run makepy on<br>
> this library I get:<br>
><br>
> def GetComponents(self, oAxisComponentsArray=defaultNamedNotOptArg):<br>
> return self._ApplyTypes_(1611005953, 1, (24, 0), ((8204, 3),),<br>
> u'GetComponents', None,oAxisComponentsArray)<br>
<br>
For what it's worth, the (24,0) means the function returns "void", and<br>
(8204,3) means the parameter is an IN/OUT parameter that is an array of<br>
variants.<br>
<br>
Given that, I'm a little confused as to why your original test -- where<br>
you passed the list of 12 items -- didn't work.  As an experiment, you<br>
could try changing that to say (8204,11), which means "in/out and this<br>
is the return value", but I'm not hopeful.<br>
<br>
We may need to get Mark Hammond involved in this.  He has more<br>
in-the-trenches experience here than anyone.<br>
<br>
<br>
<br>
> Afterwards I tried to interact with it as follows:<br>
><br>
> >>> from comtypes.client import CreateObject<br>
> >>> app = CreateObject('Catia.Application')<br>
> >>> app.Visible = True<br>
> >>> # I then interactively open a document in the application<br>
> >>> p1 = app.Documents.Item(2)<br>
> >>> p1<br>
> <POINTER(Document) ptr=0x577f24 at 4049490><br>
><br>
> So again, I get the "wrong" document type. If I do the same<br>
> but using late binding (by providing the "dynamic=True"<br>
> parameter) I get the following:<br>
> >>> p1<br>
> <comtypes.client.lazybind.Dispatch object at 0x028387B0><br>
<br>
Have you tried calling GetComponents with this object?  This is a<br>
late-bound object, which means it fetches the names of the methods and<br>
properties on the fly.<br>
<br>
--<br>
Tim Roberts, <a href="mailto:timr@probo.com">timr@probo.com</a><br>
Providenza & Boekelheide, Inc.<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/python-win32/attachments/20140718/17055f87/attachment-0001.html" target="_blank">http://mail.python.org/pipermail/python-win32/attachments/20140718/17055f87/attachment-0001.html</a>><br>


<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 18 Jul 2014 19:28:25 +0200<br>
From: Marco Nawijn <<a href="mailto:nawijn@gmail.com">nawijn@gmail.com</a>><br>
To: Tim Roberts <<a href="mailto:timr@probo.com">timr@probo.com</a>>, Tim Roberts <<a href="mailto:timr@probo.com">timr@probo.com</a>>;<br>
        <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
Cc: "<a href="mailto:python-win32@python.org">python-win32@python.org</a>" <<a href="mailto:python-win32@python.org">python-win32@python.org</a>><br>
Subject: Re: [python-win32] Problem passing array by reference<br>
Message-ID: <20140718192825.158e8965@mars><br>
Content-Type: text/plain; charset=US-ASCII<br>
<br>
On Fri, 18 Jul 2014 09:26:34 -0700<br>
Tim Roberts <<a href="mailto:timr@probo.com">timr@probo.com</a>> wrote:<br>
<br>
> Marco Nawijn wrote:<br>
> > An update on where I am at the moment. I managed to find the<br>
> > library that holds the definition for the GetComponents call. When<br>
> > I run makepy on this library I get:<br>
> ><br>
> > def GetComponents(self, oAxisComponentsArray=defaultNamedNotOptArg):<br>
> > return self._ApplyTypes_(1611005953, 1, (24, 0), ((8204, 3),),<br>
> > u'GetComponents', None,oAxisComponentsArray)<br>
><br>
> For what it's worth, the (24,0) means the function returns "void", and<br>
> (8204,3) means the parameter is an IN/OUT parameter that is an array<br>
> of variants.<br>
><br>
> Given that, I'm a little confused as to why your original test --<br>
> where you passed the list of 12 items -- didn't work.  As an<br>
> experiment, you could try changing that to say (8204,11), which means<br>
> "in/out and this is the return value", but I'm not hopeful.<br>
><br>
> We may need to get Mark Hammond involved in this.  He has more<br>
> in-the-trenches experience here than anyone.<br>
><br>
><br>
><br>
> > Afterwards I tried to interact with it as follows:<br>
> ><br>
> > >>> from comtypes.client import CreateObject<br>
> > >>> app = CreateObject('Catia.Application')<br>
> > >>> app.Visible = True<br>
> > >>> # I then interactively open a document in the application<br>
> > >>> p1 = app.Documents.Item(2)<br>
> > >>> p1<br>
> > <POINTER(Document) ptr=0x577f24 at 4049490><br>
> ><br>
> > So again, I get the "wrong" document type. If I do the same<br>
> > but using late binding (by providing the "dynamic=True"<br>
> > parameter) I get the following:<br>
> > >>> p1<br>
> > <comtypes.client.lazybind.Dispatch object at 0x028387B0><br>
><br>
> Have you tried calling GetComponents with this object?  This is a<br>
> late-bound object, which means it fetches the names of the methods and<br>
> properties on the fly.<br>
><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 18 Jul 2014 21:17:11 +0200<br>
From: Marco Nawijn <<a href="mailto:nawijn@gmail.com">nawijn@gmail.com</a>><br>
To: Tim Roberts <<a href="mailto:timr@probo.com">timr@probo.com</a>>, "<a href="mailto:python-win32@python.org">python-win32@python.org</a>"<br>
        <<a href="mailto:python-win32@python.org">python-win32@python.org</a>><br>
Subject: Re: [python-win32] Problem passing array by reference<br>
Message-ID:<br>
        <CA+pnd0=<a href="mailto:DZYPR1beWNViFnir5iV9i2-hmpKXB3HYhjs7f2n2cKA@mail.gmail.com">DZYPR1beWNViFnir5iV9i2-hmpKXB3HYhjs7f2n2cKA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear all,<br>
<br>
Sorry for the noise on the list. Epic fail of my freshly configured mail<br>
client.<br>
<br>
Marco<br>
<br>
<br>
On Fri, Jul 18, 2014 at 7:28 PM, Marco Nawijn <<a href="mailto:nawijn@gmail.com">nawijn@gmail.com</a>> wrote:<br>
<br>
> On Fri, 18 Jul 2014 09:26:34 -0700<br>
> Tim Roberts <<a href="mailto:timr@probo.com">timr@probo.com</a>> wrote:<br>
><br>
> > Marco Nawijn wrote:<br>
> > > An update on where I am at the moment. I managed to find the<br>
> > > library that holds the definition for the GetComponents call. When<br>
> > > I run makepy on this library I get:<br>
> > ><br>
> > > def GetComponents(self, oAxisComponentsArray=defaultNamedNotOptArg):<br>
> > > return self._ApplyTypes_(1611005953, 1, (24, 0), ((8204, 3),),<br>
> > > u'GetComponents', None,oAxisComponentsArray)<br>
> ><br>
> > For what it's worth, the (24,0) means the function returns "void", and<br>
> > (8204,3) means the parameter is an IN/OUT parameter that is an array<br>
> > of variants.<br>
> ><br>
> > Given that, I'm a little confused as to why your original test --<br>
> > where you passed the list of 12 items -- didn't work.  As an<br>
> > experiment, you could try changing that to say (8204,11), which means<br>
> > "in/out and this is the return value", but I'm not hopeful.<br>
> ><br>
> > We may need to get Mark Hammond involved in this.  He has more<br>
> > in-the-trenches experience here than anyone.<br>
> ><br>
> ><br>
> ><br>
> > > Afterwards I tried to interact with it as follows:<br>
> > ><br>
> > > >>> from comtypes.client import CreateObject<br>
> > > >>> app = CreateObject('Catia.Application')<br>
> > > >>> app.Visible = True<br>
> > > >>> # I then interactively open a document in the application<br>
> > > >>> p1 = app.Documents.Item(2)<br>
> > > >>> p1<br>
> > > <POINTER(Document) ptr=0x577f24 at 4049490><br>
> > ><br>
> > > So again, I get the "wrong" document type. If I do the same<br>
> > > but using late binding (by providing the "dynamic=True"<br>
> > > parameter) I get the following:<br>
> > > >>> p1<br>
> > > <comtypes.client.lazybind.Dispatch object at 0x028387B0><br>
> ><br>
> > Have you tried calling GetComponents with this object?  This is a<br>
> > late-bound object, which means it fetches the names of the methods and<br>
> > properties on the fly.<br>
> ><br>
><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.python.org/pipermail/python-win32/attachments/20140718/b9b807d8/attachment-0001.html" target="_blank">http://mail.python.org/pipermail/python-win32/attachments/20140718/b9b807d8/attachment-0001.html</a>><br>


<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 19 Jul 2014 13:02:26 +1200<br>
From: Peter Fraser <<a href="mailto:pfraser@spatialmedia.com">pfraser@spatialmedia.com</a>><br>
To: <a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
Subject: [python-win32] PythonWin on linux under wine<br>
Message-ID: <<a href="mailto:53C9C3A2.1070104@spatialmedia.com">53C9C3A2.1070104@spatialmedia.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
I have tried and failed to like another Python IDE  -including the $$ ones.<br>
<br>
  They all feel like they have 'static language envy'.<br>
<br>
  PythonWin does the best job of being an IDE for a *dynamic* language<br>
IMO (largely due to the cunning 'psuedo-shell', and also dynamic lookup<br>
for 'completion' etc).<br>
<br>
SO<br>
<br>
  I find myself installing PythonWin under Wine   -although it feels<br>
like a somewhat unnatural act.<br>
<br>
<br>
<br>
1. A small fix (in case someone else tries it).<br>
======================================<br>
<br>
The install on Wine  goes fine  (Specifically: Python 2.7.8 win32 from<br>
msi installer, and  then pywin32-219.win32-py2.7.exe  -on Mint 17 both<br>
x64 and 32 bit machines)<br>
<br>
-but when launching PythonWin   I get an error:<br>
<br>
unsupported operand type(s) for |: 'int' and 'NoneType'<br>
<br>
..at line 91 of keycodes.py (which lives in<br>
c:/Python27/Lib/site-packages/pythonwin/pywin/scintilla)<br>
<br>
My fix was simply to edit keycodes.py and change:<br>
<br>
from<br>
<br>
return vk, flags | this_flags<br>
<br>
to<br>
<br>
return vk, flags | (this_flags or 0)<br>
<br>
I was too lazy to work out why vk, this_flags = get_vk(toks[-1]) returns<br>
None in the second item.<br>
<br>
If someone wanted to make this change (or a better one) the PythonWin<br>
IDE would at least start under Wine.<br>
<br>
<br>
<br>
2. A workaround<br>
================<br>
I can't seem to enable the debugging toolbar *but* if I (try to) check<br>
it,*and restart*  -it is there.<br>
<br>
<br>
<br>
3. Does anyone have any other warnings/fixes/'run away' advice etc?<br>
=========================================================<br>
<br>
Is PythonWin under wine a known bad plan? A world of pain for serious<br>
development, perhaps? Any wisdom appreciated..<br>
<br>
<br>
<br>
Pete<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a><br>
<br>
<br>
------------------------------<br>
<br>
End of python-win32 Digest, Vol 136, Issue 6<br>
********************************************<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div>Anis Liyana Abdul Rahman<div><span style="font-family:tahoma,sans-serif;background-color:rgb(255,255,255)">Bachelor (Hons) Information Communication & Technology<br>

Universiti Teknologi PETRONAS,<div>Bandar Seri Iskandar,<br>31750 Tronoh,<br></div>Perak Darul Ridzuan, Malaysia.</span></div>
</div>