10 useful Office 365 PowerShell snippets

This post is written referenced by 10 useful Office 365 PowerShell snippets, I am still working on office 365 , but sometimes I forgot how can I get my tenant which I made, so I should find it then so as to see whenever I need to remember or memorize that, I introduce you about this note,

I did subscribe office 365 develop version for 1 year trial, it needs to make my own office 365 , in this trial I will do a lot of working without adfs environment, I will start it again.

If you open this post , you can see useful snippets which you used before.

I utilized this post so that create new users using powershell in a long time.

developerpack_accountsku

If you see my accountSkuId, it shows DEVELOPERPACK instead of ENTERPRISEPACK, as I’ve already mentioned I made a office365 trial version for developerpack so as to test 1 yr instead of 1 month, and If I see ConsumedUnits which describes 1 , it means I just one user as global administrator in this tenant.

 

Advertisements

About Groups for Office365

It takes to make new item on blog, I forgot totally to add new one or udpate it, but so as to elevate my ability and interesting stuff, I start again to make new item on this blog.

Anyway when I see around office 365 portal and if I make new distribution group using powershell, I can see introduction office 365 groups on top of powershell execution window, so I have a question what are these differences apparently about Groups.

If we see groups , there are four kinds of groups , for example, Office 365 groups, Distribution groups, Mail enabled security groups, Security groups. On this blog I’ll show you about explanations , differences, how to make it using powershell, it may takes times more than I expected.

If you have a experience of Active Directory , you can notice what is the Security group, this is sort of authorization for resources which we are uisng for example on the oneDrive and Sharpoint, etc., and Mail enabled security groups can be used to control access to OnDrive and Sharepoint as well as to send email to all members of the list. Distribution lists send email to all members of the list. You can even allow people outside to your organization send email to list. But if you make distribution group using powershell, it can use only in the tenant, it is not send from outside. Last thing is Office 365 groups , we may think this is related to groups, but if you make it then see in details, it looks like groups like facebook , this is a great way for teams to collaborate by giving them a group email and a shared workspace for conversations, files and calendar events.

PowerShell

  • Office 365 Groups : New Office 365 groups , use New-UnifiedGroup cmdlet
  • Distribution group : New Distribution group, use New-DistributionGroup cmdlet.
  • Security Group : New Security grooup, use New-MsoleGroup cmdlet, or New-Distribution cmdelet with Type properties with security (New-DistributionGroup -Name “File Server Managers” -Alias fsadmin -Type security)
  • Mail-enabled security groups : it looks no way using powershell, if looks like if we make new security group using new-distributiongroup cmdlet, we can change properties. if you see this link, you can know how it works.

If we make security group, there have two way, one is using New-DistributionGroup and another is new-MsolGroup, I want to know New-MsolGroup cmdlet, but if we go to link , it explained to create security group.

 

Set Pager Attribute on Active Directory

Recently I didn’t make any post of relating office365, but anyway it needs to start again.

Since when I create Bulk AD users for Office 365, I have wonder how to set pager attribute automatically using powershell without manually, and I tried to find pager attribute on the new-aduser cmdlet, it cannot find so as to set pager attribute, in case of us we are using pager attribute for special purpose to distinguish user.

Let me show example, if you have csv file to use new ad user, you can add it into new-aduser cmdlet, -OtherAttributes @{‘Pager’ = $_.Pager} , basically new-aduser cmdlet cannot support Pager attribute.

New-ADUser  -Name $SAM -DisplayName “$Displayname” -SamAccountName $SAM -UserPrincipalName $UPN -GivenName “$UserFirstname” -Surname “$UserLastname”  -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path “$OU” -EmailAddress $Email  -Office $Office -ChangePasswordAtLogon $false –PasswordNeverExpires $false -Server $ADServer -OtherAttributes @{‘Pager’=$_.Pager}
If you want to see more in details , you need to go and check below link.

https://powershell.org/forums/topic/active-directory-pager-field/

 

Office365 Security group owner change

Sometimes, it needs to change office 365 security group’s owner, normally we use set-distribution cmdlet, but when you try that, you can encounter error ,

when you want to change owner, you need to use parameter basically BypassSecurityGroupManagerCheck , and mangedby ‘s value needs to set samaccount instead of userprincipalanmesetower-securitygrp

if you want to know Set-Distribution cmdlet, you need to click below link.  https://technet.microsoft.com/ko-kr/library/bb124955(v=exchg.160).aspx

 

 

Electronic Discovery(EDiscovery)

Sometimes defined as how records managers and litigators discover content stored in electonic format. It means the process by which searches are conducted across online sources so that information meeting the criteria for a legal discovery order can be found and made available for review

Both Exchange Online and SharePoint Online suppor in-place holds. It works by retaining content where is stored when a discovery search is performed. In-place hold is able to include all kinds of content stored in a mailbox or site. If items that come under the scope of an in-place hold are edited or deleted after hold is created, the application ensures the information is retained. For example, if a mailbox owner attempts to delete an item that is on hold, Exchange Online creates a copy of the items in a folder in the Recoverable items structure. The copied items are invisible to users and client but can still be discovered and retrieved by searches. [All coments are gotten by office 365 for IT pros book]

recv1

As I know the Recoverable items structure quota is 100G, if that structure is exceeeded to that quota, there are some odd symptoms such as deleted items folder cannot clean-up even if users are trying to deleted items from user’s folder, so as to use EDiscovery feature for storing and searching data , I think users need to use online archive instead of deleteing items on their folders.

 

Anyone who are reading this EDiscovery feature, you need to know that Recoverable items sturcture, if you see Office 365 for IT Pros mentioned when that structure’s quota is exceeded , it needs to contact to increase or not of that structure, but when I checked to ms engineer, that feature is not use.

 

 

Security and Compliance in office 365 for business (1st)

Today, I’ll study and write down about security and compliance center on office 365, it looks as if to manage stored data for secure as company getting content more than now.

I have a curiosity about what is it eDiscovery and mail retention , so as to understand to be administrator and get certification for it, it needs to know and understand deeply, currently eDiscovery is using to find and hold content rleated to a legal case.

If you want to know in details , please go to this site. https://support.office.com/en-us/article/Security-and-Compliance-in-Office-365-for-business-Admin-Help-7fe448f7-49bd-4d3e-919d-0a6d1cf675bb?ui=en-US&rs=en-US&ad=US

And I’ll introduce it as I read this article and practice on my test tenant to that feature.

Get started with Office 365 SharePoint Online dev – create environment part 1

I finally find some pages related to how to make environment for office 365 sharepoint online dev, if you want to know that, you should go this link.

I’ve already created office 365 my own tenant and with my own configuration such as domain which I own, service and other service values to activate for office 365. so this post just concentrate on how to make environment for office 365 sharepoint online dev.

First. Go to SharePoint admin center , then select settings

SPAdminCenter.pngThen go to “Custom Script” section, please change value to “Allow users to run custom script on personal sites”

CustomScript.pngSecond, You go to SharePoint admin center, then open apps

apps.png Click to “App Catalog” appcatalog.png Select  “There is no app catalog site created for your tenant”. then select “Create a new app catalog sitecreatenewappcat.png

You have to valid values to create app catalog site , if input properly , click “OK”createnew.png if you go to SharePoint admin center, you can see the site which you just created , it looks provisioning to that site. sitelist.png

You can use it to upload any custom apps that your organization has developed.Uploading custom apps isn’t much more complicated that uploading a document to a library and setting some properties. You can use the App Catalog site to do things like install custom or third-party apps on sites for users (also called app deployment), if you want to know more how to add custom apps and install apps, you need to go to this link.

Frankly I’m happy to make this post, it is clearly help to approach sharepoint online development.