Avatar of 247computerdoctor
247computerdoctor
Flag for United Kingdom of Great Britain and Northern Ireland asked on

power shell script for office 365 password expiry, calendars, focused inbox

hi, i hope you are well.

id like to build a power shell script for 365 to

1) turn off , domain wide, password expiry in office 365
2) set exisitng users calendars to uk location, uk time zone ((unless this can be done domain wide for existing and future)
3) turn off focused inbox for existing users (unless this can be done domain wide for existing and future)
PowershellMicrosoft OfficeMicrosoft 365

Avatar of undefined
Last Comment
247computerdoctor

8/22/2022 - Mon
Alan Cox

1) turn off , domain wide, password expiry in office 365
Are you using AAD Connect? This would be controlled via Active Directory. ELSE, Get-MSOLUser  | Set-MSOLUser –PasswordNeverExpires $true
OR... Admin center/Settings/Security & Privacy

2) set exisitng users calendars to uk location, uk time zone ((unless this can be done domain wide for existing and future)

https://www.vspbreda.nl/nl/ms-office/office-365/solved-office-365-bulk-set-language-and-time-zone-for-all-users-in-office-365/

3) turn off focused inbox for existing users (unless this can be done domain wide for existing and future)

https://docs.microsoft.com/en-us/office365/admin/setup/configure-focused-inbox?view=o365-worldwide
247computerdoctor

ASKER
hi alan, thanks for your time

i'll look at the links thanks.

the first bit of code i think just iterates through existing users. i want it off on the whole domain, and i dont want to have to go into the admin centre to do it, i want to add it to my script that makes connectors, turns on dkim etc.

i guess its not possible to domain wide change the calendar options as that doesnt really make much sense,  andt i can see that you could change it for existing users. can the default for a new user be changed  for both requests 2) and 3)
Alan Cox

set-organizationconfig -focusedinboxon $False

for #1 are you using AAD Connect?

Admin center solution is a one time thing tenant wide.
Your help has saved me hundreds of hours of internet surfing.
fblack61
247computerdoctor

ASKER
oh top one for the focused inbox! i dont know anyone who likes it. well done.

i have not used aad connect.

i know i can go into the admin centre and turn it off, but it would be great if i can run my first time connect script in PS and have it do all the tedious crap that i might otherwise forget. ms even suggest one of the first things you do is turn it off, and yet they have it turned on by default! crazy!
ASKER CERTIFIED SOLUTION
Alan Cox

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
247computerdoctor

ASKER
we'll have to agree to disagree on the ficused inbox!

i look after lots of very small companies, so we dont do much else with 365 other than email and office licenses.

ok, i'll wait and see if anyone else has any magic bits of code for turning off password expiry, thanks for your help so far.