Extract contacts in DistList with Powershell from Outlook 2010 - list

Goodmorning everybody, and thanks for your attention.
I've a problem with importing contacts (that are into groups) from Outlook 2010.
After connection to Outlook and Exchange, and the select of the folders (all public folders), i cannot see all the lists contacts for some lists.
This is the connection to Outlook and it seems working.
$Outlook = New-Object -com Outlook.Application
$Namespace = $outlook.GetNamespace("MAPI")
$PublicFolder = $Namespace.Folders.Item("Public folders - name#domain.com")
$PublicFolders = $PublicFolder.Folders.Item("All public folders")
$SharedContactsFolder = $PublicFolders.Folders.Item("myfolder")
And now.. the problems..
$DLArray = #()
$ItemsArray = #()
$ItemsArray = $SharedContactsFolder.Items | ToArray
In ItemsArray i need to have all the contacts of myfolder, that are divided in IPM.Contacts and IPM.DistList
ToArray is a function that force items into an array, and it works good.
The problem appears with and without ToArray function, so it isn't the main cause.
I can access to contacts into the first 15 lists in $ItemsArray, after i see only the names of lists but i cannot extract contacts from there, using directly $SharedContactsFolder.Items there aren't improvements.
Properties like .Members and .OneOffMembers works only for the first 15 lists.
Is not an array problem, because using directly $SharedContactsFolder.Items[1] doesn't works anyway.
Thanks a lot to everybody, sorry for my englis that's no good.

Related

In Sitecore how do I update a large number of placeholder settings that are using dynamic placeholders

For some reason the placeholder key for a large number of pages changed I need to change it back. The problem is we use dynamic place holders so parts of the placeholder key are random GUIDs and they are in every sublayouts placeholder key
So I need
/bacontent/../baproducttabscaffold{6e0244e2-3583-47cb-b575-0bc920186d42}
to be
/bacontent/../baproducttabscaffold{895ecd6f-4abb-478d-9dad-88e5e05b8c30}
What would be the most efficient way of changing these?
What I ended up doing is using Sitecore Powershell Extensions
https://marketplace.sitecore.net/en/Modules/Sitecore_PowerShell_console.aspx
The script I used
$pages = gci -Path "master:\my path" -Recurse
$oldGuid = "6e0244e2-3583-47cb-b575-0bc920186d42"
$newGuid = "895ecd6f-4abb-478d-9dad-88e5e05b8c30"
foreach($page in $pages){
$oldRenderings = $page.__Renderings
$newRenderings = $oldRenderings.Replace($oldGuid, $newGuid)
$page.BeginEdit()
$page.__Renderings = $newRenderings
[void]$page.EndEdit()
}

Show Sharepoint incomplete surveys

I have created Sharepoint survey with "Page Separator" type questions. But, even I am farm admin, I am unable to view responses of an incomplete survey. I need to show total number of participant and how many of them complate survey, how many of them incomplete.
I have run this PowerShell. It does not work me, because $unPublishedEntries.Count is always zero
$unPublishedEntries.Count=0
$survey.ItemCount=56
$survey.Items.Count=3
$web = Get-SPWeb "http://portal.tracy.com/sites/GD/"
$survey = $web.lists["Survey"]
$unPublishedEntries = $survey.Items | ? {-not $_.HasPublishedVersion}
Write-Host "Surveys in list: " $survey.ItemCount
Write-Host "Of which entries are incomplete: " $unPublishedEntries.Count
Foreach ($entry in $unPublishedEntries)
{
Write-Host $entry["Author"]
}
Why I can not see (56-3) 53 users?
Also, I have run this query to check database
[sql query][1]
But, "tp_level = 255" shows deleted surveys too. If I try "tp_level = 1" it shows complated surveys, but it include deleted surveys too.
Is there any solution?
Hi you need to run sql query
This Solution work for me :
http://yasingokhanyuksel.blogspot.com.tr/2015/11/incomplete-surveys-in-sharepoint.html
Thanks

Zend Regex Routes in Application.ini not recognized

I've been struggling with this problem the last 2 hours. I'm trying to add a regex-route to my Zend Framework (V1) application. My other routes are static and stored in my application.ini file and that is where i want to put some new regex-routes.
Before i continue to work on more complex regex routes i started to translate the following (working) route to a regex route:
resources.router.routes.shift-display.route = /shift/display/:id
resources.router.routes.shift-display.defaults.module = shift
resources.router.routes.shift-display.defaults.controller = index
resources.router.routes.shift-display.defaults.action = display
Here is what i came up with:
resources.router.routes.shift-display.type = "Zend_Controller_Router_Route_Regex"
resources.router.routes.shift-display.regex = "shift/display/(\d+)"
resources.router.routes.shift-display.defaults.module = shift
resources.router.routes.shift-display.defaults.controller = index
resources.router.routes.shift-display.defaults.action = display
resources.router.routes.shift-display.map.1 = id
resources.router.routes.shift-display.reverse = "shift/display/%d"
But it's not working. It seems the route isn't recognized by the router. When trying to open e.g. vh.localhost/shift/display/7 i get "Invalid controller specified (display)" so the router uses the default route. I also tried to prepend the regex-route with a slash. I tried to use the url-helper to generate links (with passed ID param) using the new regex-route and it works.
Anyone has a clue?
Sometimes is it just that simple. When definining the route, the mistake was made in that line:
resources.router.routes.shift-display.regex = "shift/display/(\d+)"
It has to be
resources.router.routes.shift-display.route = "shift/display/(\d+)"
4 hours for nothing. But at least I finally found it ;-)

MAPI, HrQueryAllRows: Filter messages on subject

I'm pretty much new to MAPI and haven't wrote much C++ Code.
Basically I want to read all emails in the inbox and filter them based on their subject text. So far I'm using the source code provided at the microsoft msdn website which basically reads all emails from the inbox. What I want now is to not get all emails but filter them on the subject, lets say: I want all emails in my Inbox with the subject title "test".
So far I figuered out that the following line of code retrieves all the mails:
hRes = HrQueryAllRows(lpContentsTable, (LPSPropTagArray) &sptCols, &sres, NULL, 0, &pRows);
The parameter &sres is from the type SRestriction.
I tried to implement a filter on 'test' in the subject:
sres.rt = RES_CONTENT;
sres.res.resContent.ulFuzzyLevel = FL_FULLSTRING;
sres.res.resContent.ulPropTag = PR_SUBJECT;
sres.res.resContent.lpProp = &SvcProps;
SvcProps.ulPropTag = PR_SUBJECT;
SvcProps.Value.lpszA = "test";
ScvProps is from the type SPropValue.
If i execute the application then I get 0 lines returned. If I change the String test to an empty String then I get all emails.
I'm assuming i'm using the "filter" option wrong, any ideas?
Edit: When I change the FuzzyLevel to:
sres.res.resContent.ulFuzzyLevel = FL_SUBSTRING;
then I can look for subjects that contain a single character but as soon as I add a second character I get 0 rows as result. I'm pretty sure this is just some c++ stuff that I don't understand that causes all this problems ...
I figured the problem out.
Replacing
sres.res.resContent.ulFuzzyLevel = FL_FULLSTRING;
sres.res.resContent.ulPropTag = PR_SUBJECT;
SvcProps.ulPropTag = PR_SUBJECT;
with
sres.res.resContent.ulFuzzyLevel = FL_SUBSTRING;
sres.res.resContent.ulPropTag = PR_SUBJECT_A;
SvcProps.ulPropTag = PR_SUBJECT_A;
fixed the problem.

How to get the SPWorkflowStatus for a SharePoint 2013 workflow

I'm trying to get the SPWorkflowStatus for a SharePoint 2013 workflow. I was just trying something simple like getting the workflows for a specific SPListItem and trying to access the SPWorkflowStatus. In the process I also noticed that I'm only seeing SPWorkflowAssociation values for the list when they are SharePoint 2010 workflows. I'm not seeing SPWorkflowAssociation entries for the list when it is a SharePoint 2013 workflow. I can only figure that I'm missing something specific to SP2013 workflows. Any insight is appreciated.
Are you using PowerShell to get list association workflow and item workflow?
I can get the association workflow for list using the code below
$wfm = New-object Microsoft.SharePoint.WorkflowServices.WorkflowServicesManager($web)
$sub = $wfm.GetWorkflowSubscriptionService()
$subscriptions = $sub.EnumerateSubscriptionsByList($list.ID)
$siteURL = "URL"
$web = Get-SPWeb $siteURL
$list = $web.lists[$listname]
$items = $list.GetItems()
$items[0][$workflowname]