Thursday, July 16, 2015

What is the cloud?

The cloud is a friendly way of describing web-based computing services that are hosted outside of your organization. When you use cloud-based services, your IT infrastructure resides off your property (off-premises), and is maintained by a third party (hosted), instead of residing on a server at your home or business (on-premises) that you maintain. With Office 365, for example, information storage, computation, and software are located and managed remotely on servers owned by Microsoft. Many services you use every day are a part of the cloud—everything from web-based email to mobile banking and online photo storage. Because this infrastructure is located online or “in the cloud,” you can access it virtually anywhere, from a PC, tablet, smartphone, or other device with an Internet connection.

Office 365

Office 365 refers to subscription plans that include access to Office applications plus other productivity services that are enabled over the Internet (cloud services), such as Skype for Business web conferencing and Exchange Online hosted email for business, and additional online storage with OneDrive and Skype minutes for home.
Many Office 365 plans also include the desktop version of the latest Office applications, which users can install across multiple computers and devices. The full, installed applications include: Word, Excel, PowerPoint, OneNote, Outlook, Publisher, and Access. (Publisher and Access are available on PC only.) And you can install them across multiple devices, including PCs, Macs, Android tablets, Android phones, iPad, and iPhone. When you have an active Office 365 subscription that includes the desktop version of Office, you always have the most up-to-date version of the applications.
The Office 365 plans that are online-only are a great choice for certain business needs, and they are compatible with desktop versions of Office 2010, Office 2007 (with slightly limited functionality), Office 2011 for Mac, and Office 2008 for Mac. This does not include the Exchange Online Kiosk or Office 365 Enterprise K1 plans.

All Office 365 plans are paid for on a subscription basis, monthly or annually.

Creating bunch of users using CSV file in office365

Today, I am going to create a CSV file and use it to create a bunch of users for my Office 365 installation. Now I just want to create a bunch of users.
To create a user in Office 365 by using the Azure AD module, I use the New-MSOlUser cmdlet. The syntax for this looks an awfully lot like the New-User cmdlet in the standard Active Directory module. There are not quite as many options, but the process is very similar. Here is the syntax for the New-MSOlUser cmdlet:
NAME
    New-MsolUser
SYNOPSIS
    Adds a new user to Windows Azure Active Directory.
SYNTAX
    New-MsolUser -DisplayName <string> -UserPrincipalName <string>
    [-AlternateEmailAddresses <string[]>] [-AlternateMobilePhones <string[]>]
    [-BlockCredential <Boolean>] [-City <string>] [-Country <string>] [-Department
    <string>] [-Fax <string>] [-FirstName <string>] [-ForceChangePassword <Boolean>]
    [-ImmutableId <string>] [-LastName <string>] [-LicenseAssignment <string[]>]
    [-LicenseOptions <LicenseOption[]>] [-MobilePhone <string>] [-Office <string>]
    [-Password <string>] [-PasswordNeverExpires <Boolean>] [-PhoneNumber <string>]
    [-PostalCode <string>] [-PreferredLanguage <string>] [-State <string>]
    [-StreetAddress <string>] [-StrongPasswordRequired <Boolean>] [-TenantId <Guid>]
    [-Title <string>] [-UsageLocation <string>] [<CommonParameters>]
To use the cmdlet, it is as simple as filling in the blanks. Here is a quick example:
New-MsolUser -UserPrincipalName "ex@example.Com" -City
 Charlotte -State NC -Country USA -DisplayName Scripting
In this command, I did not assign a password. The cmdlet returns a user object, and that user object includes a password. I could then pipe the information from the returned object to Send-SMTPMail to send the user information and password to the user. The cool thing is that I do not have to create a password, nor do I have to supply one when I create the new user. Here is the output from the command in the Windows PowerShell console:



When I go to the Office 365 tenant admin site, I can see that the Scripting Wife user has indeed been created:




Add information to properties of external contacts

After you run the command in step 2, the external contacts are created, but they don’t contain any of the contact or organization information, which is the information from the most of the cells in the CSV file).
Run the following commands to add the other properties from the CSV file to the external contacts you created:
$Contacts = Import-CSV .\externalcontacts.csv
$contacts | ForEach {Set-Contact $_.Name -StreetAddress $_.StreetAddress -City $_.City -StateorProvince $_.StateorProvince -PostalCode $_.PostalCode -Phone $_.Phone -MobilePhone $_.MobilePhone -Pager $_.Pager -HomePhone $_.HomePhone -Company $_.Company -Title $_.Title -OtherTelephone $_.OtherTelephone -Department $_.Department -Fax $_.Fax -Initials $_.Initials -Notes $_.Notes -Office $_.Office -Manager $_.Manager}
Don’t worry if you don’t have all the information populated in the CSV file. If it’s not there, it won’t be added.
Note: The Manager parameter can be problematic. If the cell is blank in the CSV file, you will get an error and none of the property information will be added to the contact. If you don’t need to specify a manager, then just delete –Manager $_.Manager from the previous PowerShell command.

That’s it. You can view the contact properties in the Exchange Control Panel. Users can see the contacts in the address book Outlook and Outlook Web App.

Create external contacts

In this step (and the next one), you have to use Windows PowerShell. To connect PowerShell to your Exchange Online organization.
After you connect PowerShell to your cloud-based organization, run the following command to create the external contacts:
Import-Csv .\ExternalContacts.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}
Note: This command assumes that you are in the desktop directory in PowerShell. For example, C:\Users\Administrator\desktop.

To view the new external contacts, in the Exchange Control Panel, click Users & Groups > External Contacts > Refresh. They also appear in the shared address book in Outlook and Outlook Web App.

Hide external contacts from the shared address book

Some companies may use external contacts only so they can be added as members of distribution groups. In this scenario, they may want to hide external contacts from the shared address book. Here’s how:
Hide a single external contact
Set-MailContact <external contact> -HiddenFromAddressListsEnabled $true
For example, to hide Franz Kohl from the shared address book:
Set-MailContact “Franz Kohl” -HiddenFromAddressListsEnabled $true
Hide all external contacts
Run the following command to hide all external contacts from the shared address book:

Get-Contact -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'MailContact')} | Set-MailContact -HiddenFromAddressListsEnabled $true

Removing a group of users in office365

If you need to remove a group of users, You can once again use the CSV file. In fact, if you want to remove the users you just created, it is super simple. All you need to do is to use the Remove-MsolUser cmdlet instead of the New-MSOlUser cmdlet. you want also want to use the –Force parameter. If you do not, the command will prompt for each user, which is probably not what you want to do. Here is the command without the –Force parameter:
PS C:\> $users = Import-Csv C:\fso\Office365Users.CSV
PS C:\> $users | ForEach-Object { Remove-MsolUser -UserPrincipalName $_.userprincipalname}
Confirm
Continue with this operation?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):
So instead, you use the –Force parameter as shown here:
$users | ForEach-Object { Remove-MsolUser -UserPrincipalName $_.userprincipalname -Force}

No output returns from this command.