tag:blogger.com,1999:blog-2930065037642794736.post4356938897036303353..comments2023-05-22T05:51:48.796-05:00Comments on Perl H@ckers SharePoint Blog: The SharePoint / Perl Connection (Part 1)John Weflerhttp://www.blogger.com/profile/16426197714148067660noreply@blogger.comBlogger35125tag:blogger.com,1999:blog-2930065037642794736.post-81223109567257648052014-01-28T10:11:10.894-06:002014-01-28T10:11:10.894-06:00I was struggling for days with an issue i had usin...I was struggling for days with an issue i had using perl to fetch an internal web page where authentication was failing on a 401. your clue in this post of not needing the NT domain name solved my issue! Thanks Karl, thanks Google, thanks to the Interweb!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-46759525927665169472013-05-02T13:40:57.466-05:002013-05-02T13:40:57.466-05:00I upload 150 documents to Sharepoint every week; i...I upload 150 documents to Sharepoint every week; is there an easier way to check-in the docs? I'm trying to get a Perl script working but having authentication errors with the $lists = $soap->GetListCollection(); line.Bryan Anoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-70458548990182397032012-09-13T06:17:13.840-05:002012-09-13T06:17:13.840-05:00Hey John,
I am getting a 401 Unauthorized error wi...Hey John,<br />I am getting a 401 Unauthorized error with this script.<br />Also, I don't find $domain = substr($challenge, $c_info->{domain}{offset}, $c_info->{domain}{len}); line in my NTLM.pm.<br /><br />May i am using some different version of perl. Please help me out. Thanks.Anujhttp://anuj10.blogspot.comnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-16236961310061153552012-03-28T10:49:52.719-05:002012-03-28T10:49:52.719-05:00Hi - I tried out this code (thanks so much for pos...Hi - I tried out this code (thanks so much for posting by the way) and am getting a "Can't connect to MySITE:80 " error. I was unable to change the NTLM.pl script because mine did not have the domain line mentioned. Any thoughts on this? <br /><br />Thanks so much.<br />Maryapennyhttps://www.blogger.com/profile/09446032195099129354noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-53371676287737336622012-03-21T09:08:46.533-05:002012-03-21T09:08:46.533-05:00Hey Scott! I would look into PowerShell.. I'v...Hey Scott! I would look into PowerShell.. I've seen a few PowerShell based IRC bots in my day, and PowerShell can easily hook into the SharePoint .NET object model.John Weflerhttps://www.blogger.com/profile/16426197714148067660noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-59936543614724881862012-03-19T23:40:24.710-05:002012-03-19T23:40:24.710-05:00Hey guys, I am trying to figure out how to pull in...Hey guys, I am trying to figure out how to pull information continuously from a sharepoint site and have any updates announced in an IRC Channel. Anyone played with that before?Unknownhttps://www.blogger.com/profile/13552152287717667309noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-28783790396035898472012-03-02T03:51:17.423-06:002012-03-02T03:51:17.423-06:00Thanks a lot John.It is working now :)
Thanks ver...Thanks a lot John.It is working now :)<br /><br />Thanks very much,<br />PoojaPoojahttps://www.blogger.com/profile/02096110056461982516noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-57433438995333554222012-03-01T08:38:34.288-06:002012-03-01T08:38:34.288-06:00Pooja, you need the ISO date format: "yyyy-m...Pooja, you need the ISO date format: "yyyy-mm-dd". ex: "2012-03-01".<br /><br />SharePoint will store a time even with columns that are set to "Date Only". The default time is 00:00:00 or midnight.<br /><br />Here's how I set a "Data Only" field with PowerShell using .NET DateTime object:<br /><br />[DateTime]::Today.ToString("yyyy-MM-ddTHH:mm:ssZ")John Weflerhttps://www.blogger.com/profile/16426197714148067660noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-62841905206648418612012-03-01T05:25:08.263-06:002012-03-01T05:25:08.263-06:00Hi,
I have a perl script which populates items to...Hi,<br /><br />I have a perl script which populates items to a Sharepoint list.I added a new column Date in the same Sharepoint List.The date format is M/D/YYYY.When I am adding date in this format (ex: 3/1/2012) from a perl script,my perl script is failing.<br /><br />Is their any specific format in which date should be inputted to a sharepoint using perl script.<br />Can someone help me on this?<br /><br />Thanks,<br />PoojaPoojahttps://www.blogger.com/profile/02096110056461982516noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-44411083583597766752011-12-15T11:06:16.509-06:002011-12-15T11:06:16.509-06:00Here's a failed attempt to further illustrate ...Here's a failed attempt to further illustrate what I'm trying to do. The query here was ignored and the default view was returned.<br /><br />sub lists_getitems<br />{<br /> my $listid = shift;<br /> my $listName = name('listName' => $listid);<br /> my $in_viewName = name('viewName' => '');<br /> my $rowLimit = name('rowLimit' => 999999);<br /> my $query = name('Query' => value(<br /> name('Where' => value(<br /> name('Gt' => value(<br /> name('FieldRef')->attr({ 'Name' => 'ID'}),<br /> name('Value' => 1)->attr({ 'Type' => 'Counter'})<br /> ))<br /> ))<br /> ));<br /> my $viewFields = name('ViewFields' => value(<br /> name('FieldRef')->attr({ 'Name' => 'ID'}),<br /> name('FieldRef')->attr({ 'Name' => 'Title'})<br /> ));<br /> my $queryOptions = name('QueryOptions' => SOAP::Data->value(<br /> name('IncludeMandatoryColumns' => 'false'),<br /> name('DateInUtc' => 'true')<br /> ));<br /><br /> my $call = $soap->GetListItems($listName, $in_viewName, $query, $viewFields, $rowLimit, $queryOptions);<br /> die $call->faultstring() if defined $call->fault();<br /> return $call->dataof('//GetListItemsResult/listitems/data/row');<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-30745932984522965742011-12-14T14:20:31.983-06:002011-12-14T14:20:31.983-06:00Guessing the empty portion of my post relates to X...Guessing the empty portion of my post relates to XML tags not getting treated like text. The query I want to send is simple, something like "ID Gt 0", to bring back all list items.<br /><br />The main thing is to send a query to override the Sharepoint List default view.<br /><br />Thanks in advance for any information.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-78775771831177753012011-12-14T14:02:14.065-06:002011-12-14T14:02:14.065-06:00I used a slightly modified version of this code fo...I used a slightly modified version of this code for almost 2 years, but recently ran into a problem.<br />The line:<br />my $call = $soap->GetListItems($in_listName, $in_viewName, $in_rowLimit);<br />returns the items I need using the "default" view of the Sharepoint list.<br /><br />The problem I ran into occurs when the "default" view returns a folder or folders instead of navigating to the end documents.<br /><br />What I need to do for robustness is send a "query" to override the default. I know<br />the Sharepoint GetListItems method allows for this and that the XML I want to send looks something like:<br /><br /> <br /> <br /> <br /> 0<br /> <br /> <br /><br /><br />Has anyone had to do something like this using perl SOAP::Lite and can share the code?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-73977593971835566832011-08-10T23:47:27.727-05:002011-08-10T23:47:27.727-05:00My problem is resolved now.I am able to write on a...My problem is resolved now.I am able to write on a List in Sharepoint site.<br /><br />Edit site\lib\Authen\NTLM.pm to change the following line from:<br /><br />$domain = substr($challenge, $c_info->{domain}{offset}, $c_info->{domain}{len});<br /><br />to:<br /><br />$domain = &unicode($domain);<br /><br />If you don't do that, you'll get authentication errors while running the script!<br /><br />Thanks,<br />PoojaPoojahttps://www.blogger.com/profile/02096110056461982516noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-37199013455979752482011-08-05T12:58:37.355-05:002011-08-05T12:58:37.355-05:00I am getting the exact same issue as Pooja :(I am getting the exact same issue as Pooja :(psue99https://www.blogger.com/profile/08523269798150525357noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-64237636775105583732011-06-10T01:52:27.874-05:002011-06-10T01:52:27.874-05:00Hi John,
I am also getting same kind of error as H...Hi John,<br />I am also getting same kind of error as Harry has mentioned.My script is exiting on line:<br /><br />$lists = $soap->GetListCollection();<br /><br />with message <br />401 Unauthorized at sharepoint.pl line 27<br /><br />I have already added the following line in my perl script:<br />use LWP::Authen::NTLM ;<br /><br />As I am a newbie in sharepoint,I am not much aware of the cause of this error.Please help me to resolve this.<br /><br />Thanks in advance,<br />My mail id: poojanair16@gmail.com<br /><br />Pooja NairPoojahttps://www.blogger.com/profile/02096110056461982516noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-52033656443809041322011-05-18T15:57:28.941-05:002011-05-18T15:57:28.941-05:00I tried both NTML and Kerberos authentication site...I tried both NTML and Kerberos authentication sites. I got the same result 401 error. I'll try the link but nor sure how to re-get.<br /><br />Thanks.<br />HarryHarry Chenhttps://www.blogger.com/profile/12656962476070804073noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-1526967435615457082011-05-18T12:52:37.161-05:002011-05-18T12:52:37.161-05:00Hey Harry,
I guess the easy questions are: What&...Hey Harry,<br /><br />I guess the easy questions are: What's your farm level authentication setting? Is it Kerberos?<br /><br />Also, you may try to re-get LWP::Authen::NTLM from CPAN.<br /><br />http://search.cpan.org/~gaas/libwww-perl/lib/LWP/Authen/Ntlm.pmJohn Weflerhttps://www.blogger.com/profile/16426197714148067660noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-38071908083991526762011-05-18T12:14:21.667-05:002011-05-18T12:14:21.667-05:00Since we have several users requested to integrate...Since we have several users requested to integrate with Perl, we are try to follow this instruction to test it. We run into authentication issues using the code in the blog. I'm SharePoint architect but with limited experience on Perl.<br /><br />The exception is on line:<br />$lists = $soap->GetListCollection(); <br />401 Unauthorized at E:\Share\ws\ws.pl line 27<br />Client-Warning: Unsupported authentication scheme 'ntlm'.<br /><br />Here are my steps to setup.<br /><br />1. Setup ActivePerl<br />2. Install SOAP:Lite through cpan command<br />3. Setup SharePoint site and list and grant site collection admin to the test user account<br /><br />I also tried to add the following line:<br />use Authen::NTLM; ntlmv2(1); <br /><br />But got error:<br />E:\Share\ws>ws1.pl<br />Can't locate Authen/NTLM.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64<br />/lib .) at E:\Share\ws\ws1.pl line 3.<br /><br />It seems like the NTLM.pm is inside C:\Perl64\lib\LWP\Authen.<br /><br />I'm on window XP 2008 R2 64bit VM.<br /><br />Could anyone help? Please email me harryc@qualcomm.com.<br /><br />Appreciate your help in advance.<br /><br />HarryHarry Chenhttps://www.blogger.com/profile/12656962476070804073noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-32895731165187284872011-03-14T12:10:51.728-05:002011-03-14T12:10:51.728-05:00Thought I'd follow-up my original comments. I...Thought I'd follow-up my original comments. I got all this working successfully against Sharepoint 2007 last year.<br /><br />We're currently testing against Sharepoint 2010 and I was able to use my 2007 code without modification.<br /><br />Neil.NBhttps://www.blogger.com/profile/14716219354241507971noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-35168850555982528062011-02-14T20:10:01.170-06:002011-02-14T20:10:01.170-06:00Any idea how to get Query's to work with this?...Any idea how to get Query's to work with this??? it is all simple XML in my Javascript/SOAP implimentation - but I must admit this is all WAY over my head!<br /><br />I tried adding something like:<br /><br />my $in_query = name('query' =><br /><br />But no luck...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-64574361849826635822011-02-01T10:53:06.965-06:002011-02-01T10:53:06.965-06:00Worked it out. Here's the working code:
my...Worked it out. Here's the working code:<br /> my $guid = "{e5bf0d2e-c9fd-4a2b-ae79-ef2baf739975}";<br /> my $guid_name = name('guid', $guid);<br /> my $guid_array = name('array', [$guid_name]);<br /> my $call = $psir_soap->CheckInResources($guid_array);<br /> die($call->faultstring()) if defined $call->fault();Pavel Chernikovhttps://www.blogger.com/profile/14425147172746503284noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-78893748101529094222011-02-01T10:09:54.843-06:002011-02-01T10:09:54.843-06:00I'm trying to update some information on Proje...I'm trying to update some information on Project Server, via spi/resource, and having issues with the first step - <br /><br />While calling CheckOutResources, passing in array of guids, I keep getting:<br /><br />System.Web.Services.Protocols.SoapException: ProjectServerError(s) LastError=GeneralParameterCannotBeNull Instructions: Pass this into PSClientError constructor to access all error information<br /> at Microsoft.Office.Project.Server.WebService.Resource.CheckOutResources(Guid[] array)<br /><br />Here's my code:<br /><br /> my $guid = "{e5bf0d2e-c9fd-4a2b-ae79-ef2baf739975}";<br /> my $guid_name = name('guid', $guid);<br /> my $call = $soap->CheckOutResources([$guid_name]);<br /> die($call->faultstring()) if defined $call->fault();<br /><br />Any ideas / suggestions are appreciated.Pavel Chernikovhttps://www.blogger.com/profile/14425147172746503284noreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-5792600748435291302010-08-19T16:14:44.866-05:002010-08-19T16:14:44.866-05:00I have being playing with this today.
The "...I have being playing with this today.<br /> <br />The "$soap->GetListCollection()" works and returns the lists, but I am having problems with the "$soap->GetListItems($in_listName, $in_viewName, $in_rowLimit);". I get the following error:<br />"Value does not fall within the expected range."<br /> <br />Has anyone else got this error or know what the problem is?<br />(some googling suggests that something might be missing or have a wrong name in values passed to GetListItems)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-28011639643355078222010-08-12T11:34:38.258-05:002010-08-12T11:34:38.258-05:00BTW, you don't need to hack NTLM.pm (at least ...BTW, you don't need to hack NTLM.pm (at least if using version 1.05). Instead, you can modify your code to do something like this:<br /><br /> use Authen::NTLM; ntlmv2(1);<br /> our $sp_username = '\\wef';<br /> our $sp_password = 'Pa$$word16';<br /><br />Basically, tell Authen::NTLM to use ntlmv2, and don't specify an NT domain name in your username.Karlnoreply@blogger.comtag:blogger.com,1999:blog-2930065037642794736.post-56513473234505622042010-04-05T12:17:45.860-05:002010-04-05T12:17:45.860-05:00The "dynamically generated" file name is...The "dynamically generated" file name is created with another process not documented here.. ;DJohn Weflerhttps://www.blogger.com/profile/16426197714148067660noreply@blogger.com