October 19th, 2012, 12:00 PM
Update an excel file on sharepoint via Perl script
1. Find if a user exists in Active Directory or not - I have the script.
2. Grant user access in SVN. I have the script add a user under the right group for a project for r or rw access.
3. Now, I have to maintain an excel file available on our companies sharepoint site. Lets say it exists at the following link:
http:// some server /somelocation/ Excelfile.xls
Excel file just have one single sheet "Sheet1".
Sheet1 has a the following columns (and rows containing valid values) which stores access information for a repository/project/platform etc. See attached image.
UserID VTName Project Module Platform Repository Access Action Date Status
c123456 Mercurial AEIH Skrono Linux /a/b/c/d RW Modify 10/16/2012 15:00:00 MT Active
skagiga CVS MQDC TAMQ Windows /x/y/z R Add 10/15/2012 12:30:00 MT Active
u654321 Mercurial AEIH Skrono Linux /a/b/c/d RW Modify 10/16/2012 14:00:00 MT Inactive
Actions that I need is to write a Perl script to do the following in easy understandable way:
1. Checkout this .xls file from sharepoint to local folder.
2. Update this file with for a user.
a. If it's a new user. Add an entry to this file
b. If user exists, then see if user's permission/access requested is different than what we already have.
i. If different, then update that row
ii. If same, dont do anything just exit out successfully.
c. If user needs to be delete, then mark "Status" column as "Inactive" - otherwise in all other cases, it'll hold an "Active" value.
d. Script will perform necessary checks that whether a user exists in Windows AD(Active Directory) before performing any operation in SVN access and updating the .xls file.
e. .xls file should be sorted via userid. All the columns (except Userid, Module and Date) in the sheet are FILTERD via its
value (depends upon user what you select / to see rows matching that value for FILTERED fields).
3. Check-in this file back to Sharepoint so that information is up to date as soon as someone runs the above actions via a Perl Script.
Has anybody tried this and share the script / a base script so that I can start.
October 19th, 2012, 12:41 PM
See my answer on your cross post at perlguru.