Tags for Scripts | NUBO GmbH

TitleTypeExcerpt
How do I authenticate towards Graph API with PowerShell? Post The Graph Explorer is a good way to play around with the Graph API endpoints without worrying about how the authentication process has to be performed towards your environment. On the other hand, our aim is to write PowerShell scripts which perform operations against our resources in an autonomous...
Getting started with the Graph API and PowerShell Post The Microsoft Graph API is used to connect to the data that drives productivity such as mail, calendar, contacts, documents, directory, devices, and more through a unified endpoint accessible through REST. The API can be used to build productivity apps, governance solutions, or to perform automation/maintenance activities towards these assets...
Manage the group memberships using the Yammer REST API and PowerShell Post This post will show how to use the Yammer REST API for managing the group memberships of a group. You can find the documentation of the Yammer REST API here. You can generate the baerer token as described in this post. ...
Export the recycle bin information of a SharePoint site into Excel Post I have been asked to create a CSV export of the site collection recycle bin on SharePoint on-premises. I came to two snippets that can be executed on the server using PowerShell. The first snippet uses the SharePoint PowerShell commandlets. The second script uses the SharePoint server side code.
Assigning site collection admin rights to all OneDrive for Business sites - Revisited Post The problem In a previous blog post I showed how to assign site collection admin rights to all SharePoint Online site collections in your tenant. You can use the script presented here if you want to do the same for OneDrive for business sites. I am going to...
Enumerate OneDrive for Business contents using PowerShell Post The aim of this script is to get a fast overview about the contents of a OneDrive for Business document library. The script uses CSOM to traverse the data and outputs it for further analysis into a CSV file. Your user requires access to the OneDrive for Business personal site....
Export properties form all OneDrive for Business sites in Office 365 Post Few months ago I created a script running over provisioned OneDrive for Business sites using the MySite host in a tenant. The technique was working fine until you reached a higher amount of OneDrive sites. It started to return less sites and became unreliable. Therefore, I created a new...
Retrieving SharePoint Online Sites with PowerShell Post SharePoint service administrator use the Get-SPOSite command to query SharePoint Online site collection information. This post is going to show some examples how this can be achieved. Retrieve all site collections All site collections are retrieved with the “Get-SPOSite” command. There are some parameters that you should be...
Accessing videos with REST Video API through PowerShell Post The REST Video API is used to discover and interact with videos in the Office 365 Video service. You can find the official documentation here. This post is going to show you how you can access video data through the REST API. The examples presented in...
Accessing channels with REST Video API through PowerShell Post The REST Video API is used to discover and interact with videos in the Office 365 Video service. You can find the official documentation here. This post is going to show you how you can access channel data through the REST API. The examples presented in...
Accessing the Office 365 Video API through PowerShell Post The REST Video API is used to discover and interact with videos in the Office 365 Video service. You can find the official documentation here. The API allows you to interact with the Video Channels and Videos and perform all operations necessary to build your own Video portal interface...
Configure expiration time for external sharing links Post In this post we will focus on “Configure expiration time for external sharing links” in SharePoint Online and OneDrive for Business for our tenant. The action in Secure Score is described as follows: Action Category Score Description Configure expiration...
Force the unlock operation on a SharePoint on-premises site collection Post When performing a SharePoint site collection backup a lock operation is enabled in the background. This usually when you use an operation like Backup-SPSite without additional parameters. This results in a site collection becoming read only during the backup operation for your end users with a message like that on...
Provision the SQL Servers for SharePoint Post The lab environment is going to host two SQL Servers for SharePoint 2013 and SharePoint 2016. The servers with their IP addresses and names are listed in the next table. Server IP Role Description NUB01SQL 192.168.0.12 Sql Server 2014 This...
Enable mailbox auditing for all users Post In this post we will focus on “Enable mailbox auditing for all users” in Exchange Online for our tenant. The action in Secure Score is described as follows: Action Category Score Description Enable mailbox auditing for all users Data...
Enable Office 365 audit data Post In this post we will focus on “Enabling audit data recording” in our tenant. The action in Secure Score is described as follows: Action Category Score Description Enable audit data recording Data 0/15 You should enable audit data recording...
Generate a Yammer profile bulk import file through PowerShell Post The previous post described how to bulk import Yammer profiles from your Azure Active Directory through the Yammer REST API. The script will not scale on a large amount of users due to an average execution time of 2 seconds per user. A Yammer network administrator has the possibility...
Delete a hashtag from the Managed Metata Service Application through PowerShell Post This script removes a hashtag from the termstore in the Managed Metadata Service Application of a SharePoint on-premises environment. Add-PSSnapin Microsoft.SharePoint.Powershell -ea 0 $siteUrl = "PutASiteCollectionUrl" $managedMetadataProxy = "PutTheManagedMetadataProxyName" $hashTagToDelete = "PutYourHashtagWith#" $site = get-spsite
Bulk create Yammer profiles through the Yammer REST API with PowerShell Post Yammer profiles can be created with the REST interface described here. I had the requirement to provision for each Office 365 account a Yammer profile for a Yammer migration project. The script below takes all users in Azure AD and their primary proxy address. If a proxy address is...
Require passwords to be reset at least every 60 days Post The action in Secure Score is described as follows: Action Category Score Description Require passwords to be reset at least every 60 days Account 0/10 You should require that all of your users reset their password at least every...
Enable MFA for all global admins Post The first mitigation action to implement is the enablement of MFA for global administrators. The action in Secure Score is described as follows: Action Category Score Description Enable MFA for all global admins Account 0/50 You should enable MFA...
Securing your Office 365 environment Post Office 365 provides high security standard to ensure customer data is secure. On the other hand, there are still possible security threads that can be mitigated by Office 365 administrators to reduce the risk of their Office 365 data. Unfortunately, not everyone can be a security expert knowing what...
Provisioning new virtual machines through PowerShell with unattended Windows installations Post This post is a continuation of our previous post that tries to speed up the provisioning process of our Windows Server operating systems. We already created a sysprepped version of our Windows Server 2012 R2 and Windows Server 2016. These virtual machines are going to be copied to a template...
Preparing the sysprepped virtual hard disks for Windows Server Post The NUB01CORE server with AD, DNS, and Hyper-V is ready. We could start creating all other virtual machines. But before doing that, I would speed up the installation of our required Windows Servers. For this purpose, I am going to create two sysprepped virtual disks containing Windows Server 2012 R2...
Quick tip: how do I flush the blob cache for all webapplications Post Disk-based caching controls caching for binary large objects (BLOBs) such as image, sound, and video files, as well as code fragments. Disk-based caching is extremely fast and eliminates the need for database round trips. BLOBs are retrieved from the database once and stored on the Web client. Further requests are...
Setup the core server for the lab environment Post I mentioned in the previous post that our physical machine will host the core infrastructure of our enviornment. I already installed Windows Server 2016 Standard on the physical machine. I only configured the “Remote Desktop”, Static IP Address to 192.168.0.2, and the Time zone to (UTC). Finally, I executed...
Create step by step a SharePoint lab enviornment Post The aim of this blog series is to show how to setup a lab environment for SharePoint 2013 and 2016 step by step. The aim is to have a first enviornment with following software products: Active Directory SharePoint Server 2016 - Enterprise SharePoint Server 2013 - Enterprise SQL Server...
Configure the primary IP address for your network adapter in a SharePoint environment Post The problem In some situations, you need to ensure that the outgoing server communication uses a specific IPv4 address. This might happen for servers having a network card with multiple public IPv4 addresses assigned. With SharePoint, your WFEs might have multiple IP addresses assigned to a network card. Furthermore,...
Following users using the Social API in SharePoint and PowerShell Post The problem With the “old” SharePoint Social API you have the possibility to follow a user with some PowerShell commands. You might have a service user from marketing that needs to be followed by every user in your company. The scripts presented here use PowerShell and the social API...
Provision personal sites in SharePoint On-Premises Post The problem SharePoint does not automatically provisions personal sites of a user even if there is a user profile in the user profile service application. The provisioning of the site typically happens once the user logs in for the first time on the MySite host of the SharePoint environment....
Working with users using the Yammer REST API and PowerShell Post In this post I would like to go through some of the endpoints in the Yammer REST API handling user profiles in a network. You can generate the baerer token as described in this post. Always consider the REST API...
Get all Yammer users through the Yammer REST API with PowerShell Post The Yammer REST Api allows you to return users through the interface described here. A call to that API returns a batch of 50 users. You need to call multiple times the API to get all your users from the directory if you have more than 50. Therefore, I...
Get all Yammer pages through the Yammer REST API with PowerShell Post The Yammer REST Api allows you to return pages in Yammer. A call to that API returns a batch of 50 pages. The drawback is that you can’t ask for all pages without making multiple calls to the API. Therefore, I created a PowerShell snippet that is doing the necessary...
Working with groups using the Yammer REST API and PowerShell Post The Yammer REST API is well documented here. On the other hand, you might miss some documentation regarding some endpoints on that page. For example, there is no notion about how to interact with Yammer Groups. Fortunately, with a little bit of network tracing and by following the naming...
Get all Yammer messages through the Yammer REST API with PowerShell Post The Yammer REST Api allows you to return messages through the interface described here. A call to that API returns a batch of 20 messages that can be limited to fewer messages with the “limit” operation. The drawback is that you can’t ask for the last 500 messages without...
Delete a Yammer message through the Yammer REST API with PowerShell Post You can delete a message through API as described here. The snippet below shows how you can do it through PowerShell. You simply need a bearer token and the message id to delete. You can generate the baerer token as described in this post. ...
Access the Yammer REST API with PowerShell Post Yammer provides good APIs to access and interact with a Yammer network. You can get an overview of the access possibilities by opening the Yammer developer center. The API we are going to use is the Yammer REST API. In this blog post I am going to describe the...
Delete event receivers in a site collection Post The problem The script presented here allows you to search for all event receiver occurrences in a site collection. The filter criteria used in this script is only the class name of the desired event receiver. Feel free to extend it with additional filter criteria. You can use the...
Quick script: export security token issuer information and trusted root authority information form SharePoint on-premises Post The problem If your company is working since a couple of years with the development of on-premises high trust Add-ins, you might come to a situation where your trusted root authorities or security token issuers are either outdated or not maintained very well. You might consider doing some trust...
Assigning site collection admin rights to all OneDrive for Business sites Post The problem In a previous blog post I showed how to assign site collection admin rights to all SharePoint Online site collections in your tenant. You can use the script presented here if you want to do the same for OneDrive for business sites. I am going to...
Looping over all user profiles in SharePoint Online Post The problem I presented in a previous post how to loop over all user profiles on a SharePoint on-premises environment. This post is showing how you can do the same for SharePoint Online profiles. You can also find an official description on technet following this post.
Searching site collection admin occurrences in SharePoint on-premises Post The problem The script presented here is exporting all occurrences of a user as site collection admin on any site collection in a farm. Note that the user should in theory be listed at least once on his/her own personal site. The script Add-PSSnapin Microsoft.SharePoint.Powershell...
Looping over all user profiles in SharePoint on-premises Post The problem As a SharePoint admin you might come to the situation to loop over all user profiles in your organization and perform some maintenance activities. The script presented in this post is providing you some basics that you could reuse for your maintenance activities. The script
Assigning site collection admin rights to a SharePoint Online site with PowerShell Post The problem You can assign site collection admin rights to persons or groups in SPO through the user interface with the necessary SharePoint Online administration rights. On the other hand, you also have the opportunity to automate this procedure through PowerShell commands. You can use the SharePoint Online...
Detecting orphaned accounts in SharePoint Online with PowerShell Post The problem The “orphaned users” problem is a part of the life cycle management processes implemented by many organizations in SharePoint Online. You might have a SharePoint site de-provisioning process that bases the whole flow on the availability of some responsible users for that specific site in your organization....
Create high trust for SharePoint Add-ins in SharePoint on-premises Post During one of our daily IT-Pro activities we still have to setup the high trust for SharePoint Add-ins developed by other teams. During that process we usually receive a private certificate with the password. The output for the development team is a unique issuer id. The end-to-end process is described...
Export properties form all OneDrive for Business sites in Office 365 Post You can find a better approach following this link. The aim of this script is to run over all provisioned OneDrive for Business sites availalbe on a tenant and export valuable information regarding these sites. It is useful if you want to export information related...
Step by step guide - How do I create a daemon application for Office 365? Post When building Office 365 applications you usually require a user to sign-in and consent the operations executed by the application through OAuth2 authorization code grant flow. The application performs then the operations in the name of the user. At the same time it means that this only works if the...
Backup all site collection with Powershell in SharePoint on-premises Post This script is an improvement of the script I created some years ago for SharePoint 2010. The script below can be used for all environments after SharePoint 2010 and must be run on a SharePoint server. I added some paramters to allow you to filter by webapplication or define...