Microsoft Teams was announced yesterday and many want to jump right in. I noticed when users wanted to create teams, new distribution groups started getting added. I wanted to find out my ‘In cloud’ distribution groups and was surprised there was no property for the item. I was able to find out the groups…
Author: mo wasay
Migrate Office365 Photos to AD
Many of my customers have Office365 and have been using Skype for Business for sometime now. It is likely that your organization users have uploaded their profile picture. Now only if there was a way to sync those pictures back to your AD – so it looks neat & nice. There is a way!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#MigrateOffice365PhotosToAD.ps1 function Get-Office365Photo($EmailAddress,$Credential) { $wc = New-Object System.Net.WebClient $wc.credentials = $Credential # Build the URL that'll return the jpeg of the user's photo $url = "https://outlook.office365.com/ews/exchange.asmx/s/GetUserPhoto?email=$EmailAddress&size=HR96x96" # Build a path to export it to (.\[email protected]) $outPath = "$pwd\$EmailAddress.jpg" try { # Download the image and save it to the current directory $wc.DownloadFile($url,$outPath) return $outPath } catch { throw $_ } } function Upload-ADPhoto($Username,$FilePath) { # Import the photo into a variable as a byte array $photo = [byte[]](Get-Content $FilePath -Encoding byte) # Replace the current value of thumbnailPhoto with the byte array from above Set-ADUser $Username -Replace @{ThumbnailPhoto=$photo} } # Get the credential to allow us to download the images $Cred = Get-Credential -Message "Please enter your Office 365 Credentials" # Get every mail-enabled AD user $users = Get-ADUser -ldapfilter '(mail=*)' -properties mail # For each of the mail-enabled users... foreach ($user in $users) { try { # Download the photo $photoPath = Get-Office365Photo -EmailAddress $user.mail -Credential $Cred # Upload the photo Upload-ADPhoto -Username $user -FilePath $photoPath } catch { Write-Warning "Unable to update image for $($user.mail)" } } |
…
Create a Virtual Machine with 2 NICs in Azure Classic
Unfortunately, in Azure you cannot create a Virtual Machine in the GUI with 2 Network Cards. You cannot even add a 2nd NIC to a VM once it has been created. The only way to create a VM with 2, is to specify the additional NIC’s at the time of creation and ONLY via powershell….
Active Directory: Changing passwords for users in bulk using a .csv file
Many accounts in your AD might need a password change. What if you want to do this in bulk ? First, we need to the userlist. Depending on your requirements we need to get a list of users (specifically samaccountname). For random password generation I recommend using http://manytools.org/network/password-generator/ as it can generate up 1000 for…
Extending the Booking days for Conference Room Calendar (Resource)
By default Office365 limits Resource booking days to just 180 days. The maximum days it can be booked for 1080 days. I like to make resource booking days 1 year from the day of making the reservation/ appointment. Now instead of visiting each calendar and making the change, powershell can help us out.
1 2 3 4 5 6 7 8 9 |
#Connect to Office365 $cred = Get-Credential Import-Module MSOnline Connect-MsolService -Credential $cred $s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection $importresults = Import-PSSession $s #Get all the Rooms and make the booking days to 365 Get-MailBox | Where {$_.ResourceType -eq "Room"} | Set-CalendarProcessing -BookingWindowInDays 365 |
Happy…
Linux: CentOS 6 kernel panic+0xa7/0x16f fix
So ran into a view issue for a Linux Host today. Kernel Panic !!! There could be a number of reasons that you might get this error. The three common reasons may be: There was a change to selinux config – (that might be an error in the config file) There are disk errors The…
VMware: Intermittent Error: Unexpected character ‘’ (code 65279 / 0xfeff) in prolog; expected ‘<' at [row,col {unknown-source}]: [1,1] pop up in Windows vSphere client ?
Recently, I got the error below when using the vSphere client. Problem: I have only tested this solution on: Solution: Repair your installation of Microsoft Visual J#® 2.0 Redistributable Package – Second Edition (x64) Download The error went away after repair. In trying to google the error some user have reported that uninstall the patch KB3147458 worked for…
Windows: Hide Internet Explorer 11 address bar & navigation bar
Applies to: Windows Server 2008R2, Windows Server 2012R2, Windows 10 There are two ways this can be accomplished depending on your needs for the controlled environment. GPO: I would like to first clarify that there is not a single GPO to just hide TABS in IE11. There is however a way you can enforce IE in Full…
Excel: Check email addresses in bulk if format is correct or not
So had a request today to clean up email addresses as some of them were not valid. This was needed for over 1500 email addresses. So used the formula below and was able to find all addresses that were “FALSE”. I filtered them out and was able to fix them as needed. Here’s what you…
DFS Namespace service could not initialize cross forest trust information
After you install Active Directory on Windows Server 2008 R2, you may start seeing the following error message after the server boots: The DFS Namespace service could not initialize cross forest trust information on this domain controller, but it will periodically retry the operation. The return code is in the record data. This occurs because…