Friday, December 15, 2017

Print all file in a folder

Twice a year I have to print a lot of files in different formats. It's easy to do with a little PowerShell:

Get-ChildItem c:\receipt\ | ForEach-Object {start-process $_.FullName –Verb Print}

Monday, December 4, 2017

Deploying Office Online Server 2016 to a security hardened drive

I was installing an Office Online Server. And properly the easy thing to install in a complete SharePoint farm setup Smile After installing and configuring the OOS farm. I did a bit of testing. But I ended up with this error:

clip_image002

This error only occur on Word file, not PowerPoint or Excel file Confused smile

After a lot a googling, I found the reason is I installed the OOS on to a D drive “a security hardened drive”.

https://blogs.technet.microsoft.com/office_web_apps_server_2013_support_blog/2013/11/26/deploying-office-web-apps-server-2013-to-a-security-hardened-drive/

Thursday, November 16, 2017

Global Office 365 Developer Bootcamp - Cheatsheet

List of useful links introduce doing the SPBG Global Office 365 Developer Bootcamp:


Monday, October 23, 2017

Add Usage Guidelines Url for Office 365 Group

While I was configuring Classification for Groups, when I sported the UsageGuidelinesUrl and GuestUsageGuidelinesUrl option. When set, a link appears in the Site Information box.

Guideline

PowerShell to add, update, read and remove the guidelines urls

Add

# get the settings id default template for Groups
$settingTemplateID = Get-AzureADDirectorySettingTemplate | ? -Property "DisplayName" -Value "Group.Unified" -EQ | select -ExpandProperty ID
#get the tempalte object
$Template = Get-AzureADDirectorySettingTemplate -Id $settingTemplateID
#create a setting object
$newSetting = $template.CreateDirectorySetting()
#set the property
$newSetting["GuestUsageGuidelinesUrl"] = "http://guestguideline.com"
$newSetting["UsageGuidelinesUrl"] = "https://guideline.com"
#save the settings object back to Office 365
New-AzureADDirectorySetting -DirectorySetting $newSetting

Update

#Get the setting id for Groups
$settingID = Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ | select -ExpandProperty ID
#Get current settings object with the Groups ID
$setting = Get-AzureADDirectorySetting –Id $settingID
#Update the property
$Setting["UsageGuidelinesUrl"] = "https://my-tenant.sharepoint.com/"
$Setting["GuestUsageGuidelinesUrl"] = "http://public-url"
#Save the settings object back to Office 365
Set-AzureADDirectorySetting -Id $settingID -DirectorySetting $Setting

Read

#read all settings
(Get-AzureADDirectorySetting -All $True).Values

Remove – All settings for Groups!

#remove all settings
$settingID = Get-AzureADDirectorySetting | Where-object -Property Displayname -Value "Group.Unified" -EQ | select -ExpandProperty ID
Remove-AzureADDirectorySetting –Id $settingID

Tuesday, September 19, 2017

Global Office 365 Developer Bootcamp

If you work with Office 365 development, the Danish SharePoint User Group (SPBG) has an event that is interesting to you. The event is free, about developments in Microsoft Graph and Microsoft Teams. November 16, 2017. Arrangements consist of theory and hands-on labs. Read more about event and registration at https://www.meetup.com/Danish-SharePoint-User-Group-SPBG/events/243080575/

Tuesday, July 4, 2017

SPBG ERFA møde omkring Microsoft Teams

Kom til SPBG erfa møde torsdag den 24. august, i København, og mød Peter Lunding Smith. Peter er Director Cloud & Innovation fra ProActive. Peter vil give en introduktion til Microsoft Teams og fortælle om hvordan du kommer i gang med at bruge Teams og hvad man kan bruge i forretningen. Vi afholder mødet hos Executives' Global Network fra kl. 17:00 til ca. 19 tiden. S.U den 20. august. Tilmelding sker på http://spbg.dk

Monday, March 27, 2017

The lazy man’s Select-Object Expression

I have known the Select-Object Expression pattern since I started with PowerShell. Where the syntax is this:

select-object @{Name="Property1"; Expression={$_.PropertyObject.Property1}}

But a new PowerShell tip I lean this week is a syntax:

select-object {$_.PropertyObject.Property1}

The big difference is the headline on the column. In the first example, I control the column headline and the second example the headline will be:

$_.PropertyObject.Property1
-----------------------------------------

Friday, March 10, 2017

Microsoft Office Developer Community Events, SPFx, MS Graph og Teams

Kom til et gratis heldags arrangement omkring udvikling i SharePoint Framework, Microsoft Graph og Microsoft Teams i København den 11. maj 2017.

På dagen bliver der givet en introduktion til udvikling i det nye SharePoint Framework, Microsoft Graph og Microsoft Teams. Kendskab til SharePoint/Office 365 udvikling ikke nødvendig, dog en fordel hvis du kan kode noget i forvejen!

Agenda:

  • SharePoint Framework.
  • Microsoft Graph.
  • Microsoft Teams: Bots, Connectors og Tabs.

Format:
Formatet for dagen vil være, at der bliver en del teori, i form af PowerPoint og demo. Men en rigtig stor del af dagen vil gå med demo, hvor deltagerne selv koder med (hands-on-labs).

Du kan læse mere her og tilmelde, https://www.meetup.com/Danish-SharePoint-User-Group-SPBG/events/238107058/

Tuesday, March 7, 2017

Microsoft Tech Summit Copenhagen

Microsoft Tech Summit is comming to Copenhagen. If you have not already seen it, Microsoft is organizing a Tech Summit. The event is free. The event is on March 30-31, 2017. You can read more about the event and sign up for it there https://www.microsoft.com/da-dk/techsummit/copenhagen.aspx

Tuesday, February 28, 2017

Filter on multible coluFilter on multiple columns in SharePoint rest API

I’m build a small JavaScript/REST base application for a customer. Where we to filter on three columns. Filter on one column is easy and straight forward. $filter=MyColumn eq 'myvalue’. But filtering on multiple columns is not as apparent. When I was read the documentation on it. It seems you need to add $filter multiple time to the query. But that is not true. The $filter operator shall only be added one time. Insert added AND/OR between them yours filters. Like $filter=MyColumn1 eq 'myvalue’ AND MyColumn2 eq ‘myvalue’. Or in my case, where I need to find an item between a minimal value and a maximum value.

"$filter=BodyRef eq '" + result + "' and Min le '" + size + "' and Max ge '" + size + "'"

Monday, February 27, 2017

Get SharePoint logs

It is getting old PowerShell script but did need it recently. The script collection log files from all the servers in the farm for a given period.

Tip: $time is the copy/paste value from the SharePoint error message box.

$time = "23-02-2017 11:26:52"
$time = $time.Trim()
$timeToAdd = 10
$startTime = [Datetime]::Parse($time)
$endTime = $startTime.AddSeconds($timeToAdd)
$path = "c:\temp\log $($time.Replace(":", [String]::Empty)).txt"
Merge-SPLogFile -StartTime $startTime -EndTime $endTime -Path $path -Overwrite