Sharing folder via WMI: Win32_Account from remote?Hello everyone<br/><br/>I have been working on some functions for crating share via WMI (Win32_Share), with custom permissions.<br/><br/>but i have one issue.<br/><br/>I use the Win32_Account class to find the user/group's SID, it works great when questioning the local machine.<br/>but when trying to retrieve them frmo a remote machine, it only gives me the local users.<br/><br/>I think that this is by design?<br/>but is there any way i can retrieve the SID's from the remote PC via WMI ?<br/>(in case this PC is on another domain than me, but i have special permissions to connect via WMI).<br/><br/>You can download my script at <br/><a href="http://blog.coretech.dk/scripting/powershell-wmi-working-with-shares-part-1-creating-a-share-with-custom-permissions/">http://blog.coretech.dk/scripting/powershell-wmi-working-with-shares-part-1-creating-a-share-with-custom-permissions/</a><br/><br/>Please provide any feedback if you have it. I want to continue improving the script (this is version 0.0.1)<br/><br/>thanks! :)<br/>Best Regards<br/>Jakob Gottlieb Svendsen<br/> <hr class=sig> Trainer/Consultant - Coretech A/S - <a href="http://blog.coretech.dk/author/jgs">Blog</a> - MCT - MCTS - VB.NET - C#.NET - Powershell - VBScript© 2009 Microsoft Corporation. All rights reserved.Mon, 31 Aug 2009 03:45:57 Zab74a764-9b38-45d6-b09e-960b60dcc0aehttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#ab74a764-9b38-45d6-b09e-960b60dcc0aehttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#ab74a764-9b38-45d6-b09e-960b60dcc0aeJakob Svendsenhttp://social.technet.microsoft.com/Profile/en-US/?user=Jakob%20SvendsenSharing folder via WMI: Win32_Account from remote?Hello everyone<br/><br/>I have been working on some functions for crating share via WMI (Win32_Share), with custom permissions.<br/><br/>but i have one issue.<br/><br/>I use the Win32_Account class to find the user/group's SID, it works great when questioning the local machine.<br/>but when trying to retrieve them frmo a remote machine, it only gives me the local users.<br/><br/>I think that this is by design?<br/>but is there any way i can retrieve the SID's from the remote PC via WMI ?<br/>(in case this PC is on another domain than me, but i have special permissions to connect via WMI).<br/><br/>You can download my script at <br/><a href="http://blog.coretech.dk/scripting/powershell-wmi-working-with-shares-part-1-creating-a-share-with-custom-permissions/">http://blog.coretech.dk/scripting/powershell-wmi-working-with-shares-part-1-creating-a-share-with-custom-permissions/</a><br/><br/>Please provide any feedback if you have it. I want to continue improving the script (this is version 0.0.1)<br/><br/>thanks! :)<br/>Best Regards<br/>Jakob Gottlieb Svendsen<br/> <hr class=sig> Trainer/Consultant - Coretech A/S - <a href="http://blog.coretech.dk/author/jgs">Blog</a> - MCT - MCTS - VB.NET - C#.NET - Powershell - VBScriptWed, 01 Jul 2009 10:54:26 Z2009-07-01T10:54:55Zhttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#9e144f43-4d0a-4c20-9e5f-07ea1632ca8dhttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#9e144f43-4d0a-4c20-9e5f-07ea1632ca8dAbqBillhttp://social.technet.microsoft.com/Profile/en-US/?user=AbqBillSharing folder via WMI: Win32_Account from remote?Hi Jakob,<br/> <br/> This works for me:<br/> <br/> <pre>gwmi Win32_Account -computer <em>servername</em> </pre> <br/> BillWed, 01 Jul 2009 15:26:26 Z2009-07-01T15:26:26Zhttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#85e03549-d64f-44a0-a28f-c3ecbfb98f70http://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#85e03549-d64f-44a0-a28f-c3ecbfb98f70Jakob Svendsenhttp://social.technet.microsoft.com/Profile/en-US/?user=Jakob%20SvendsenSharing folder via WMI: Win32_Account from remote?Hello<br/><br/>Thank you for testing<br/><br/><br/>Does it show all domain users too on your system?<br/><br/>I was testing from a vista Pc to another vista.<br/><br/><br/><br/><hr class="sig">Trainer/Consultant - Coretech A/S - <a href="http://blog.coretech.dk/author/jgs">Blog</a> - MCT - MCTS - VB.NET - C#.NET - Powershell - VBScriptThu, 02 Jul 2009 14:21:54 Z2009-07-02T14:21:54Zhttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#d099e04c-f3d3-4b11-aa14-e0109ee4be44http://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#d099e04c-f3d3-4b11-aa14-e0109ee4be44AbqBillhttp://social.technet.microsoft.com/Profile/en-US/?user=AbqBillSharing folder via WMI: Win32_Account from remote?Hi Jakob,<br/> <br/> <pre>get-wmiobject Win32_Account -computername <em>servername</em></pre> <br/> only retrieves Win32_Account objects on the named computer. To retrieve domain accounts, you can use <br/> <br/> <pre>get-wmiobject Win32_Account -filter &quot;Domain='domainname'&quot;</pre> <br/> HTH,<br/> <br/> BillThu, 02 Jul 2009 14:47:49 Z2009-07-02T14:49:23Zhttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#c38c53a8-fdcc-4238-a9cd-dfe32d6a2a65http://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#c38c53a8-fdcc-4238-a9cd-dfe32d6a2a65Jakob Svendsenhttp://social.technet.microsoft.com/Profile/en-US/?user=Jakob%20SvendsenSharing folder via WMI: Win32_Account from remote?Hello agani :)<br/><br/>thanks for trying to help :) :)<br/><br/>but i think you may have misunderstood my problem.<br/><br/> <pre>get-wmiobject Win32_Account -computername <em>servername</em></pre> Correct, this retrieves accounts from the remote PC, but only the local accounts from that PC.<br/>If the PC has joined another domain, you cannot get the accounts from that domain.<br/><br/> <pre>get-wmiobject Win32_Account -filter &quot;Domain='domainname'&quot;</pre> yes its the same as when i use the [WMI] accellerator on the local PC.<br/>But this only gives the domain accounts for the doman, from which the local PC is joined.<br/>if a remote PC has joined another domain that the macihne running the script, you cannot retrieve info on those accounts.<br/><br/>so my problem is (and i gues it cannot be solved) that i cannot get those accounts, from the remote PC.<br/>Have a nice weekend! :)<br/><br/><br/>- Jakob<hr class="sig">Trainer/Consultant - Coretech A/S - <a href="http://blog.coretech.dk/author/jgs">Blog</a> - MCT - MCTS - VB.NET - C#.NET - Powershell - VBScriptFri, 03 Jul 2009 08:01:57 Z2009-07-03T08:01:57Zhttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#0ec31f55-9b3d-4530-b17a-dba54be1b87chttp://social.technet.microsoft.com/Forums/en/ITCG/thread/ab74a764-9b38-45d6-b09e-960b60dcc0ae#0ec31f55-9b3d-4530-b17a-dba54be1b87cAbqBillhttp://social.technet.microsoft.com/Profile/en-US/?user=AbqBillSharing folder via WMI: Win32_Account from remote?Hi Jakob,<br/> <br/> A brief search didn't reveal such such a limitation provided your script provides appropriate credentials to allow it to query accounts on a different domain. In that case, my thought would be to query the accounts on a domain controller rather than a member machine. But I am unable to test here as I only have a single domain.<br/> <br/> Regards,<br/> <br/> BillFri, 03 Jul 2009 16:03:11 Z2009-07-03T16:03:11Z