Monday, December 25, 2017

Powershell get error/exception details

Leave a Comment
Sometime while executing script we find some exceptions/error e.g. Access is denied. So to see details of inner except just run following powershell command:

$error[0]|format-list -force
Read More

Powershell script to get folder and their filename in SharePoint, Project Server

Leave a Comment
I was asked for project documentation auditing to get listing of folders & files for all projects in Project Server 2016. Excercise is to make sure all project managers adhere to business check related to docuemntation must be provided for all project phases. So here is the script to do the magic

$folder = "\\SomePRojectserver\pwa\";
$toInclude =("Shared Documents");
$outputFolder="C:\TempOutput\output.csv";
gci -recurse -Path $folder | select parent,name,Directory |? { $_.Directory -match $toInclude }|
Export-Csv $outputFolder -Encoding UTF8
Read More

Run powershell script as domain user from non-domain computer

Leave a Comment
Recently I need to run one powershell script which will bring all files in EPM project folder for project documentation audit. Since I worked as consultant and mostly working on my personal laptop  at different client side. So I was struggling to run this powershell script

$folder = "\\SomePRojectserver\pwa\";
$toInclude =("Shared Documents");
$outputFolder="C:\TempOutput\output.csv";
gci -recurse -Path $folder | select parent,name,Directory |? { $_.Directory -match $toInclude }|
Export-Csv $outputFolder -Encoding UTF8

Reason is b/c powershell take my logged in user credentials either run powershell as administrator with elevated prvilages. So trick is to run following command either through cmd, powershell or through run command:

.\runas.exe /netonly /user:domain\username powershell.exe
Read More

Tuesday, December 19, 2017

Power BI / Excel: OData feed Dataformat error "The given URL neither points to an OData service or a feed"

Leave a Comment
Scenario:
While updating some of columns in Power BI / Excel I started facing following error:

DataFormat.Error: OData: The given URL neither points to an OData service or a feed:"http://SomeEPMServer/pwa/_api/Projectdata/Projects". Although if you tried same rest api/odata feed in browser it fetch related project feed.

Causes:
 Somehow my credentials for data source which I set to used as current user credentials has not been working.

Solution:
Delete current set up credentials from Datasource settings-> Edit permission and update it to be used as current windows account at organizational level.
Read More

Project server: reserve keyword custom field odata feed

Leave a Comment
Issue: Odata error processing request:



We should not use reserve keyword while creating custom fields for project server (2010/2013/2016). What I faced while using Power BI through OData feed was facing conflict of my custom field with reserve keyword.
Cause: Duplicate custom field
There was a field called "Project ID" but this custom field internal name become "projectid" which is reserve internal field use by Project server for referencing different projects

Solution: 
Just rename custom field "Project ID" to "Internal Project ID" and it solve the issue.



 
Read More