I need to figure out how to restrict access to Office365 services for our hourly employees. We sync using DirSync only - we don't have ADFS. I'm hoping there is some powershell command I can run on a schedule that can disable their account at 5:00pm and enable their account at 8:00am every work day.
Asked
Active
Viewed 1,527 times
1 Answers
0
You can use Set-MsolUser
like this to disable users completely:
Set-MsolUser -UserPrincipalName <User Principal Name> -blockcredential $True
But you can also control the access more granular. For more Info look here: Disable access to service

Paul
- 5,524
- 1
- 22
- 39
-
Thanks. I did research before asking. If I was as smart as you, maybe I'd be the one answering questions instead of asking them. Next time, please don't be a jerk before knowing what a person did before asking the question. – Jeremy Oct 20 '14 at 19:22
-
I am sorry, i do not mean to be a jerk. It seems what i consider basic research skills is not as basic as i thought when i take a look at half the questions with the powershell tag. – Paul Oct 20 '14 at 19:30
-
It's ok. The only powershell knowledge I have is duplicating the commands I find on the net when I need something specific - which is rare. If I found I needed a wider knowledge of it, I'd probably take a class. Thanks again for the answer! – Jeremy Oct 20 '14 at 20:28