1

I have created a few publishing pages in Pages library using powershell. When I go to the Pages library I don't see them via the UI. However, I can see them via powershell script.

If I go to Site Content and I look at the Pages library, I see the number of items is 57, but when I go inside the library I am able to browse only 46.

The user that I am logged in is: Site Collection administrator, belongs in the Onwers group for this library, I have added it in the Approvers and other appropriate groups, but still I can't see the items.

What am I missing? I have run out of ideas. Some help will be very much appreciated.

Edit 1: I have checked the default view and there is no filtering. I have created another view just in case, still cannot see the items.

  • 2
    I think that new publishing pages are checked out by default. So you could try to check them in / publishing them using powershell. Or use the account that you ran the powershell script with in the UI. – Christoffer May 8 '15 at 9:27
  • Glad it helped. :) – Christoffer May 8 '15 at 10:07
1

Thanks to user19952 I was able to make the connection. Yes, it was true! Powershell was running under a different user account then the one I had logged on. This was because I am sharing my environment with other people and we are using the same account. So someone must have logged in on Powershell using a different account.

From now on I will always include this in my powershell script to see which user is running the script:

$userRunningScript =  [Security.Principal.WindowsIdentity]::GetCurrent().Name
Write-Host "***************** User Account executing the script **************" -ForegroundColor Green
Write-Host $userRunningScript -ForegroundColor Green
Write-Host "******************************************************************" -ForegroundColor Green

I should had checked this long time ago.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.