diff --git a/exchange/exchange-ps/exchange/move-and-migration/New-MoveRequest.md b/exchange/exchange-ps/exchange/move-and-migration/New-MoveRequest.md index 4ae88570a8..d42f6a9463 100644 --- a/exchange/exchange-ps/exchange/move-and-migration/New-MoveRequest.md +++ b/exchange/exchange-ps/exchange/move-and-migration/New-MoveRequest.md @@ -25,7 +25,7 @@ New-MoveRequest [-Identity] [-Outbound] [-RemoteC [-DomainController ] [-IgnoreRuleLimitErrors] [-MRSServer ] [-PrimaryOnly] [-Priority ] [-Protect] [-RemoteArchiveTargetDatabase ] [-RemoteOrganizationName ] [-RemoteTargetDatabase ] [-Suspend] [-SuspendComment ] - [-SuspendWhenReadyToComplete] [-TargetDeliveryDomain ] [-WhatIf] [-CheckInitialProvisioningSetting] + [-SuspendWhenReadyToComplete] [-TargetDeliveryDomain ] [-WhatIf] [-CompleteAfter ] [-CompletedRequestAgeLimit ] [-ForceOffline] [-IncrementalSyncInterval ] [-InternalFlags ] [-LargeItemLimit ] [-PreventCompletion] [-SkipMoving ] [-StartAfter ] @@ -44,7 +44,7 @@ New-MoveRequest [-Identity] [-Remote] [-RemoteCre [-IgnoreRuleLimitErrors] [-MRSServer ] [-PrimaryOnly] [-Priority ] [-Protect] [-RemoteOrganizationName ] [-Suspend] [-SuspendComment ] [-SuspendWhenReadyToComplete] [-TargetDatabase ] [-TargetDeliveryDomain ] [-WhatIf] [-RemoteLegacy] - [-CheckInitialProvisioningSetting] [-CompleteAfter ] [-CompletedRequestAgeLimit ] + [-CompleteAfter ] [-CompletedRequestAgeLimit ] [-ForceOffline] [-IncrementalSyncInterval ] [-InternalFlags ] [-LargeItemLimit ] [-PreventCompletion] [-RemoteTargetDatabase ] [-SkipMoving ] [-StartAfter ] @@ -63,7 +63,7 @@ New-MoveRequest [-Identity] -RemoteCredential ] [-Suspend] [-SuspendComment ] [-SuspendWhenReadyToComplete] [-TargetDatabase ] [-TargetDeliveryDomain ] [-WhatIf] [-Remote] -RemoteHostName [-ArchiveDomain ] [-ArchiveOnly] [-ArchiveTargetDatabase ] - [-CheckInitialProvisioningSetting] [-CompleteAfter ] [-CompletedRequestAgeLimit ] + [-CompleteAfter ] [-CompletedRequestAgeLimit ] [-ForceOffline] [-IncrementalSyncInterval ] [-InternalFlags ] [-LargeItemLimit ] [-PreventCompletion] [-PrimaryOnly] [-RemoteOrganizationName ] [-SkipMoving ] [-StartAfter ] @@ -80,7 +80,7 @@ New-MoveRequest [-Identity] [-AcceptLargeDataLoss [-BatchName ] [-Confirm] [-DomainController ] [-DoNotPreserveMailboxSignature] [-IgnoreRuleLimitErrors] [-MRSServer ] [-PrimaryOnly] [-Priority ] [-Protect] [-Suspend] [-SuspendComment ] [-SuspendWhenReadyToComplete] [-TargetDatabase ] [-WhatIf] - [-CheckInitialProvisioningSetting] [-CompleteAfter ] [-CompletedRequestAgeLimit ] + [-CompleteAfter ] [-CompletedRequestAgeLimit ] [-ForceOffline] [-ForcePull] [-ForcePush] [-IncrementalSyncInterval ] [-InternalFlags ] [-LargeItemLimit ] [-PreventCompletion] [-SkipMoving ] [-StartAfter ] @@ -95,7 +95,7 @@ New-MoveRequest [-Identity] [-AcceptLargeDataLoss New-MoveRequest [-Identity] [-Outbound] [-RemoteCredential ] [-RemoteGlobalCatalog ] -RemoteHostName [-TargetDeliveryDomain ] [-AcceptLargeDataLoss] [-AllowLargeItems] [-ArchiveDomain ] [-ArchiveOnly] [-BadItemLimit ] [-BatchName ] - [-CheckInitialProvisioningSetting] [-CompleteAfter ] [-CompletedRequestAgeLimit ] + [-CompleteAfter ] [-CompletedRequestAgeLimit ] [-Confirm] [-DomainController ] [-ForceOffline] [-IgnoreTenantMigrationPolicies] [-IncrementalSyncInterval ] [-InternalFlags ] [-LargeItemLimit ] [-MigrationMailbox ] [-MoveOptions ] [-PreventCompletion] @@ -112,7 +112,7 @@ New-MoveRequest [-Identity] [-Outbound] [-RemoteC ``` New-MoveRequest [-Identity] [-Outbound] -RemoteTenant -TargetDeliveryDomain [-AcceptLargeDataLoss] [-AllowLargeItems] [-BadItemLimit ] - [-BatchName ] [-CheckInitialProvisioningSetting] [-CompleteAfter ] + [-BatchName ] [-CompleteAfter ] [-CompletedRequestAgeLimit ] [-Confirm] [-DomainController ] [-ForceOffline] [-IgnoreTenantMigrationPolicies] [-IncrementalSyncInterval ] [-InternalFlags ] [-LargeItemLimit ] [-MoveOptions ] [-PreventCompletion] @@ -741,23 +741,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -CheckInitialProvisioningSetting -The CheckInitialProvisioningSetting switch specifies that the move request checks the IsExcludedFromProvisioning setting on the target database when you don't specify a target database for the move. You don't need to specify a value with this switch. - -The IsExcludedFromProvisioning setting allows the database to be excluded from provisioning new mailboxes. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -CompleteAfter The CompleteAfter parameter specifies a delay before the request is completed. The request is started, but not completed until the date/time you specify with this parameter. diff --git a/exchange/exchange-ps/exchange/policy-and-compliance-dlp/Set-DlpSensitiveInformationTypeRulePackage.md b/exchange/exchange-ps/exchange/policy-and-compliance-dlp/Set-DlpSensitiveInformationTypeRulePackage.md index 5879d07225..0915583a18 100644 --- a/exchange/exchange-ps/exchange/policy-and-compliance-dlp/Set-DlpSensitiveInformationTypeRulePackage.md +++ b/exchange/exchange-ps/exchange/policy-and-compliance-dlp/Set-DlpSensitiveInformationTypeRulePackage.md @@ -11,7 +11,7 @@ monikerRange: "o365scc-ps" ## SYNOPSIS This cmdlet is available only in the Office 365 Security & Compliance Center. For more information, see Office 365 Security & Compliance Center PowerShell (https://technet.microsoft.com/library/mt587091.aspx). -Use the Set-DlpSensitiveInformationTypeConfig cmdlet to update existing data loss prevention (DLP) sensitive information type rule packages in the Security & Compliance Center. +Use the Set-DlpSensitiveInformationTypeRulePackage cmdlet to update existing data loss prevention (DLP) sensitive information type rule packages in the Security & Compliance Center. For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https://technet.microsoft.com/library/bb123552.aspx). diff --git a/exchange/exchange-ps/exchange/users-and-groups/New-MailUser.md b/exchange/exchange-ps/exchange/users-and-groups/New-MailUser.md index 2ab281f953..bc7055f326 100644 --- a/exchange/exchange-ps/exchange/users-and-groups/New-MailUser.md +++ b/exchange/exchange-ps/exchange/users-and-groups/New-MailUser.md @@ -17,171 +17,151 @@ For information about the parameter sets in the Syntax section below, see Exchan ## SYNTAX -### Set1 -``` -New-MailUser [-Name] -ExternalEmailAddress [-Alias ] - [-ArbitrationMailbox ] [-Confirm] [-DisplayName ] [-DomainController ] - [-FirstName ] [-ImmutableId ] [-Initials ] [-LastName ] +### DisabledUser +``` +New-MailUser [-Name] -ExternalEmailAddress + [-Alias ] + [-ArbitrationMailbox ] + [-Confirm] + [-DisplayName ] + [-DomainController ] + [-FirstName ] + [-ImmutableId ] + [-Initials ] + [-LastName ] [-MacAttachmentFormat ] - [-MessageBodyFormat ] [-MessageFormat ] - [-ModeratedBy ] [-ModerationEnabled <$true | $false>] + [-MailboxRegion ] + [-MessageBodyFormat ] + [-MessageFormat ] + [-ModeratedBy ] + [-ModerationEnabled <$true | $false>] [-OrganizationalUnit ] - [-OverrideRecipientQuotas] [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-UsePreferMessageFormat <$true | $false>] - [-WhatIf] [-ExternalDirectoryObjectId ] - [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-UsageLocation ] [-MailboxRegion ] [-SkipMailboxProvisioningConstraintValidation] - [] -``` - -### Set3 -``` -New-MailUser [-Name] -ExternalEmailAddress -Password - -UserPrincipalName [-Alias ] [-ArbitrationMailbox ] [-Confirm] - [-DisplayName ] [-DomainController ] [-FirstName ] [-ImmutableId ] - [-Initials ] [-LastName ] + [-PrimarySmtpAddress ] + [-RemotePowerShellEnabled <$true | $false>] + [-ResetPasswordOnNextLogon <$true | $false>] + [-SamAccountName ] + [-SendModerationNotifications ] + [-UsePreferMessageFormat <$true | $false>] + [-WhatIf] [] +``` + +### EnabledUser +``` +New-MailUser [-Name] -ExternalEmailAddress -Password -UserPrincipalName + [-Alias ] + [-ArbitrationMailbox ] + [-Confirm] + [-DisplayName ] + [-DomainController ] + [-FirstName ] + [-ImmutableId ] + [-Initials ] + [-LastName ] [-MacAttachmentFormat ] - [-MessageBodyFormat ] [-MessageFormat ] - [-ModeratedBy ] [-ModerationEnabled <$true | $false>] - [-OrganizationalUnit ] - [-OverrideRecipientQuotas] [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-UsePreferMessageFormat <$true | $false>] - [-WhatIf] -WindowsLiveID [-EvictLiveId] [-ExternalDirectoryObjectId ] - [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-UsageLocation ] [-MailboxRegion ] [-SkipMailboxProvisioningConstraintValidation] - [] -``` - -### Set2 -``` -New-MailUser [-Name] [-ExternalEmailAddress ] -Password - -WindowsLiveID [-Alias ] [-ArbitrationMailbox ] [-Confirm] - [-DisplayName ] [-DomainController ] [-EvictLiveId] [-FirstName ] - [-ImmutableId ] [-Initials ] [-LastName ] [-ModeratedBy ] + [-MailboxRegion ] + [-MessageBodyFormat ] + [-MessageFormat ] + [-ModeratedBy ] [-ModerationEnabled <$true | $false>] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-WhatIf] -UserPrincipalName - [-ExternalDirectoryObjectId ] [-MacAttachmentFormat ] - [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-MessageBodyFormat ] - [-MessageFormat ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-UsageLocation ] [-UsePreferMessageFormat <$true | $false>] [-MailboxRegion ] - [-SkipMailboxProvisioningConstraintValidation] [] -``` - -### Set4 -``` -New-MailUser [-Name] [-ExternalEmailAddress ] [-UseExistingLiveId] - -WindowsLiveID [-Alias ] [-ArbitrationMailbox ] [-Confirm] - [-DisplayName ] [-DomainController ] [-FirstName ] [-ImmutableId ] - [-Initials ] [-LastName ] [-ModeratedBy ] - [-ModerationEnabled <$true | $false>] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-WhatIf] - -MicrosoftOnlineServicesID -Password [-ExternalDirectoryObjectId ] - [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-UsageLocation ] [-MailboxRegion ] [-SkipMailboxProvisioningConstraintValidation] - [] -``` - -### Set5 -``` -New-MailUser [-Name] [-ExternalEmailAddress ] -FederatedIdentity - -WindowsLiveID [-Alias ] [-ArbitrationMailbox ] [-Confirm] - [-DisplayName ] [-DomainController ] [-EvictLiveId] [-FirstName ] - [-ImmutableId ] [-Initials ] [-LastName ] [-ModeratedBy ] + [-OrganizationalUnit ] + [-PrimarySmtpAddress ] + [-RemotePowerShellEnabled <$true | $false>] + [-ResetPasswordOnNextLogon <$true | $false>] + [-SamAccountName ] + [-SendModerationNotifications ] + [-UsePreferMessageFormat <$true | $false>] + [-WhatIf] [] +``` + +### MicrosoftOnlineServicesID +``` +New-MailUser [-Name] -MicrosoftOnlineServicesID -Password [-ExternalEmailAddress ] + [-Alias ] + [-ArbitrationMailbox ] + [-Confirm] + [-DisplayName ] + [-DomainController ] + [-FirstName ] + [-ImmutableId ] + [-Initials ] + [-LastName ] + [-MailboxRegion ] + [-ModeratedBy ] [-ModerationEnabled <$true | $false>] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-WhatIf] [-ImportLiveId] - [-ExternalDirectoryObjectId ] [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-UsageLocation ] [-MailboxRegion ] [-NetID ] - [-SkipMailboxProvisioningConstraintValidation] [] -``` - -### Set6 -``` -New-MailUser [-Name] [-ExternalEmailAddress ] [-ImportLiveId] - -WindowsLiveID [-Alias ] [-ArbitrationMailbox ] [-Confirm] - [-DisplayName ] [-DomainController ] [-FirstName ] [-ImmutableId ] - [-Initials ] [-LastName ] [-ModeratedBy ] + [-OrganizationalUnit ] + [-PrimarySmtpAddress ] + [-RemotePowerShellEnabled <$true | $false>] + [-ResetPasswordOnNextLogon <$true | $false>] + [-SamAccountName ] + [-SendModerationNotifications ] + [-WhatIf] [] +``` + +### FederatedUser +``` +New-MailUser [-Name] -FederatedIdentity [-ExternalEmailAddress ] + [-Alias ] + [-ArbitrationMailbox ] + [-Confirm] + [-DisplayName ] + [-DomainController ] + [-FirstName ] + [-ImmutableId ] + [-Initials ] + [-LastName ] + [-MailboxRegion ] + [-ModeratedBy ] [-ModerationEnabled <$true | $false>] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-WhatIf] [-UseExistingLiveId] [-BypassLiveId] - [-ExternalDirectoryObjectId ] [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-NetID ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-UsageLocation ] [-MailboxRegion ] [-SkipMailboxProvisioningConstraintValidation] - [] -``` - -### Set7 -``` -New-MailUser [-Name] [-ExternalEmailAddress ] -FederatedIdentity - -WindowsLiveID [-Alias ] [-ArbitrationMailbox ] [-Confirm] - [-DisplayName ] [-DomainController ] [-EvictLiveId] [-ExternalDirectoryObjectId ] - [-FirstName ] [-ImmutableId ] [-Initials ] [-LastName ] - [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-ModeratedBy ] - [-ModerationEnabled <$true | $false>] [-NetID ] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-WhatIf] [-UseExistingLiveId] [-BypassLiveId] [-MailboxRegion ] - [-SkipMailboxProvisioningConstraintValidation] [-UsageLocation ] [] + [-OrganizationalUnit ] + [-PrimarySmtpAddress ] + [-RemotePowerShellEnabled <$true | $false>] + [-ResetPasswordOnNextLogon <$true | $false>] + [-SamAccountName ] + [-SendModerationNotifications ] + [-WhatIf] [] ``` -### Set9 +### MicrosoftOnlineServicesFederatedUser ``` New-MailUser [-Name] -FederatedIdentity -MicrosoftOnlineServicesID - [-Alias ] [-ArbitrationMailbox ] [-Confirm] [-DisplayName ] - [-DomainController ] [-ExternalDirectoryObjectId ] [-FirstName ] [-ImmutableId ] - [-Initials ] [-LastName ] [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-ModeratedBy ] - [-ModerationEnabled <$true | $false>] [-NetID ] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-WhatIf] [-MailboxRegion ] [-SkipMailboxProvisioningConstraintValidation] [] -``` - -### Set8 -``` -New-MailUser [-Name] [-MicrosoftOnlineServicesID ] [-Alias ] - [-ArbitrationMailbox ] [-Confirm] [-DisplayName ] [-DomainController ] - [-ExternalDirectoryObjectId ] [-FirstName ] [-ImmutableId ] [-Initials ] - [-LastName ] [-MailboxProvisioningConstraint ] - [-MailboxProvisioningPreferences ] [-ModeratedBy ] + [-Alias ] + [-ArbitrationMailbox ] + [-Confirm] + [-DisplayName ] + [-DomainController ] + [-FirstName ] + [-ImmutableId ] + [-Initials ] + [-LastName ] + [-MailboxRegion ] + [-ModeratedBy ] + [-ModerationEnabled <$true | $false>] + [-OrganizationalUnit ] + [-PrimarySmtpAddress ] + [-RemotePowerShellEnabled <$true | $false>] + [-ResetPasswordOnNextLogon <$true | $false>] + [-SamAccountName ] + [-SendModerationNotifications ] + [-WhatIf] [] +``` + +### EnableRoomMailboxAccount +``` +New-MailUser [-Name] [-MicrosoftOnlineServicesID ] + [-Alias ] + [-Confirm] + [-DisplayName ] + [-FirstName ] + [-ImmutableId ] + [-Initials ] + [-LastName ] + [-MailboxRegion ] + [-ModeratedBy ] [-ModerationEnabled <$true | $false>] - [-OrganizationalUnit ] [-OverrideRecipientQuotas] - [-PrimarySmtpAddress ] [-RemotePowerShellEnabled <$true | $false>] - [-ResetPasswordOnNextLogon <$true | $false>] [-SamAccountName ] - [-SendModerationNotifications ] [-SKUAssigned <$true | $false>] - [-SKUCapability ] - [-WhatIf] -FederatedIdentity [-MailboxRegion ] [-NetID ] - [-SkipMailboxProvisioningConstraintValidation] [] + [-OrganizationalUnit ] + [-RemotePowerShellEnabled <$true | $false>] + [-SendModerationNotifications ] + [-WhatIf] [] ``` ## DESCRIPTION @@ -229,7 +209,7 @@ In on-premises environments, you can use the PrimarySMTPAddress parameter to set ```yaml Type: ProxyAddress -Parameter Sets: Set1, Set3 +Parameter Sets: DisabledUser, EnabledUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: True @@ -241,7 +221,7 @@ Accept wildcard characters: False ```yaml Type: ProxyAddress -Parameter Sets: Set2, Set4, Set5, Set6, Set7 +Parameter Sets: MicrosoftOnlineServicesID, FederatedUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: False @@ -258,7 +238,7 @@ The FederatedIdentity parameter associates an on-premises Active Directory user ```yaml Type: String -Parameter Sets: Set5, Set7, Set9, Set8 +Parameter Sets: FederatedUser, MicrosoftOnlineServicesFederatedUser Aliases: Applicable: Exchange Online, Exchange Online Protection Required: True @@ -268,16 +248,12 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -ImportLiveId -This parameter is available only in the cloud-based service. - -The ImportLiveID switch specifies whether to import an unmanaged Microsoft account (formerly known as a Windows Live ID) into the cloud-based domain. You don't need to specify a value with this switch. - -An unmanaged Microsoft account was created in the domain before the domain was enrolled in the cloud-based service. Importing a Microsoft account into the domain lets you save any settings associated with the Microsoft account, like instant messaging contacts. However, the Microsoft account is now subject to the security and privacy policies of the organization. +### -MicrosoftOnlineServicesID +The MicrosoftOnlineServicesID parameter specifies the user ID for the object. This parameter only applies to objects in the cloud-based service. It isn't available for on-premises deployments. ```yaml -Type: SwitchParameter -Parameter Sets: Set5, Set6 +Type: WindowsLiveId +Parameter Sets: MicrosoftOnlineServicesID, MicrosoftOnlineServicesFederatedUser Aliases: Applicable: Exchange Online, Exchange Online Protection Required: True @@ -287,33 +263,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Password -The Password parameter specifies the password for the user's account. Valid values for this parameter use the syntax (ConvertTo-SecureString -String '\' -AsPlainText -Force). - ```yaml -Type: SecureString -Parameter Sets: Set3, Set2, Set4 +Type: WindowsLiveId +Parameter Sets: EnableRoomMailboxAccount Aliases: -Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: True +Applicable: Exchange Online, Exchange Online Protection +Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -UseExistingLiveId -This parameter is available only in the cloud-based service. - -The UseExistingLiveId switch specifies whether to use the specified Microsoft account (formerly known as a Windows Live ID) that already exists in the cloud-based domain. The specified Microsoft account can't have a mail user associated with it. - -You don't need to specify a value with this switch. +### -Password +The Password parameter specifies the password for the user's account. Valid values for this parameter use the syntax (ConvertTo-SecureString -String '\' -AsPlainText -Force). ```yaml -Type: SwitchParameter -Parameter Sets: Set4, Set6, Set7 +Type: SecureString +Parameter Sets: EnabledUser, MicrosoftOnlineServicesID Aliases: -Applicable: Exchange Online, Exchange Online Protection +Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: True Position: Named Default value: None @@ -328,7 +297,7 @@ The UserPrincipalName parameter specifies the name of a system user in an email ```yaml Type: String -Parameter Sets: Set3, Set2 +Parameter Sets: EnabledUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016 Required: True @@ -338,23 +307,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WindowsLiveID -This parameter is available only in the cloud-based service. - -The WindowsLiveID parameter creates a Microsoft account (formerly known as a Windows Live ID) for the mail user. - -```yaml -Type: WindowsLiveId -Parameter Sets: Set3, Set2, Set4, Set5, Set6, Set7 -Aliases: -Applicable: Exchange Online, Exchange Online Protection -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Alias The Alias parameter specifies the Exchange alias (also known as the mail nickname) for the recipient. This value identifies the recipient as a mail-enabled object, and shouldn't be confused with multiple email addresses for the same recipient (also known as proxy addresses). A recipient can have only one Alias value. @@ -415,7 +367,7 @@ For example: ```yaml Type: MailboxIdParameter -Parameter Sets: (All) +Parameter Sets: DisabledUser, EnabledUser, FederatedUser, MicrosoftOnlineServicesID Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016 Required: False @@ -468,7 +420,7 @@ The DomainController parameter specifies the domain controller that's used by th ```yaml Type: Fqdn -Parameter Sets: (All) +Parameter Sets: DisabledUser, EnabledUser, FederatedUser, MicrosoftOnlineServicesID Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016 Required: False @@ -478,25 +430,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -EvictLiveId -This parameter is available only in the cloud-based service. - -The EvictLiveId switch specifies whether to remove an unmanaged Microsoft account (formerly known as a Windows Live ID) from the cloud-based domain. An unmanaged Microsoft account was created in the domain before the domain was enrolled in the cloud-based service. Evicting a Microsoft account from the domain lets you save any settings associated with the Microsoft account, like instant messaging contacts. - -You don't need to specify a value with this switch. - -```yaml -Type: SwitchParameter -Parameter Sets: Set3, Set2, Set5, Set7 -Aliases: -Applicable: Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -FirstName The FirstName parameter specifies the user's first name. @@ -578,7 +511,7 @@ The MacAttachmentFormat and MessageFormat parameters are interdependent: ```yaml Type: BinHex | UuEncode | AppleSingle | AppleDouble -Parameter Sets: Set1, Set3, Set2 +Parameter Sets: DisabledUser, EnabledUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: False @@ -588,6 +521,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -MailboxRegion +This parameter is avaialble only in the cloud-based service + +This parameter is reserved for internal Microsoft use. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Applicable: Exchange Online +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -MessageBodyFormat The MessageBodyFormat parameter specifies the message body format for messages sent to the mail contact or mail user. Valid values are: @@ -605,7 +555,7 @@ The MessageFormat and MessageBodyFormat parameters are interdependent: ```yaml Type: Text | Html | TextAndHtml -Parameter Sets: Set1, Set3, Set2 +Parameter Sets: DisabledUser, EnabledUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: False @@ -632,7 +582,7 @@ Therefore, if you want to change the MessageFormat parameter from Mime to Text, ```yaml Type: Text | Mime -Parameter Sets: Set1, Set3, Set2 +Parameter Sets: DisabledUser, EnabledUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: False @@ -723,21 +673,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -OverrideRecipientQuotas -This parameter is reserved for internal Microsoft use. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -PrimarySmtpAddress This parameter is available only in on-premises Exchange. @@ -749,7 +684,7 @@ If you use the PrimarySmtpAddress parameter to specify the primary email address ```yaml Type: SmtpAddress -Parameter Sets: (All) +Parameter Sets: DisabledUser, EnabledUser, FederatedUser, MicrosoftOnlineServicesID Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016 Required: False @@ -789,7 +724,7 @@ The ResetPasswordOnNextLogon parameter specifies whether the user must change th ```yaml Type: $true | $false -Parameter Sets: (All) +Parameter Sets: DisabledUser, EnabledUser, FederatedUser, MicrosoftOnlineServicesID Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016 Required: False @@ -806,7 +741,7 @@ The SamAccountName parameter (also known as the pre-Windows 2000 user account or ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: DisabledUser, EnabledUser, FederatedUser, MicrosoftOnlineServicesID Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016 Required: False @@ -848,7 +783,7 @@ The UsePreferMessageFormat specifies whether the message format settings configu ```yaml Type: $true | $false -Parameter Sets: Set1, Set3, Set2 +Parameter Sets: DisabledUser, EnabledUser Aliases: Applicable: Exchange Server 2010, Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection Required: False @@ -873,183 +808,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -MicrosoftOnlineServicesID -The MicrosoftOnlineServicesID parameter specifies the user ID for the object. This parameter only applies to objects in the cloud-based service. It isn't available for on-premises deployments. - -```yaml -Type: WindowsLiveId -Parameter Sets: Set4, Set9 -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: WindowsLiveId -Parameter Sets: Set8 -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -BypassLiveId -This parameter is reserved for internal Microsoft use. - -```yaml -Type: SwitchParameter -Parameter Sets: Set6, Set7 -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ExternalDirectoryObjectId -This parameter is reserved for internal Microsoft use. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MailboxProvisioningConstraint -This parameter is reserved for internal Microsoft use. - -```yaml -Type: MailboxProvisioningConstraint -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MailboxProvisioningPreferences -This parameter is reserved for internal Microsoft use. - -```yaml -Type: MultiValuedProperty -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -NetID -This parameter is reserved for internal Microsoft use. - -```yaml -Type: NetID -Parameter Sets: Set5, Set6, Set7, Set9, Set8 -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SKUAssigned -This parameter is reserved for internal Microsoft use. - -```yaml -Type: $true | $false -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SKUCapability -This parameter is reserved for internal Microsoft use. - -```yaml -Type: None | BPOS_S_Deskless | BPOS_S_Standard | BPOS_S_Enterprise | BPOS_S_Archive | BPOS_L_Standard | BPOS_B_Standard | BPOS_B_CustomDomain | BPOS_S_MidSize | BPOS_S_ArchiveAddOn | BPOS_S_EopStandardAddOn | BPOS_S_EopPremiumAddOn | BPOS_Unmanaged | TOU_Signed | FederatedUser | Partner_Managed | MasteredOnPremise | ResourceMailbox | ExcludedFromBackSync | UMFeatureRestricted | RichCoexistence | OrganizationCapabilityUMGrammar | OrganizationCapabilityUMDataStorage | OrganizationCapabilityOABGen | OrganizationCapabilityGMGen | OrganizationCapabilityClientExtensions | BEVDirLockdown | OrganizationCapabilityUMGrammarReady | OrganizationCapabilityMailRouting | OrganizationCapabilityManagement | OrganizationCapabilityTenantUpgrade | OrganizationCapabilityScaleOut | OrganizationCapabilityMessageTracking | OrganizationCapabilityPstProvider | OrganizationCapabilitySuiteServiceStorage | OrganizationCapabilityOfficeMessageEncryption | OrganizationCapabilityMigration -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -UsageLocation -This parameter is reserved for internal Microsoft use. - -```yaml -Type: CountryInfo -Parameter Sets: Set1, Set3, Set2, Set4, Set5, Set6, Set7 -Aliases: -Applicable: Exchange Server 2013, Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MailboxRegion -This parameter is reserved for internal Microsoft use. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipMailboxProvisioningConstraintValidation -This parameter is reserved for internal Microsoft use. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: -Applicable: Exchange Server 2016, Exchange Online, Exchange Online Protection -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216). diff --git a/skype/skype-ps/skype/New-CSOnlinePSTNGateway.md b/skype/skype-ps/skype/New-CSOnlinePSTNGateway.md index 77cf4381d6..63c4a505ab 100644 --- a/skype/skype-ps/skype/New-CSOnlinePSTNGateway.md +++ b/skype/skype-ps/skype/New-CSOnlinePSTNGateway.md @@ -18,7 +18,7 @@ Creates a new Session Border Controller (SBC) Configuration that describes the s New-CSOnlinePSTNGateway [-Tenant ] -SipSignallingPort [-CodecPriority ] [-ExcludedCodecs ] [-FailoverTimeSeconds ] [-ForwardCallHistory ] [-ForwardPai ] [-SendSipOptions ] [-MaxConcurrentSessions ] - [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-Identity] [-InMemory] [-Force] + [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-GatewaySiteLbrEnabled ] [-Identity] [-InMemory] [-Force] [-WhatIf] [-Confirm] [] ``` @@ -27,7 +27,7 @@ New-CSOnlinePSTNGateway [-Tenant ] -SipSignallingPort [-Cod New-CSOnlinePSTNGateway [-Tenant ] -Fqdn -SipSignallingPort [-CodecPriority ] [-ExcludedCodecs ] [-FailoverTimeSeconds ] [-ForwardCallHistory ] [-ForwardPai ] [-SendSipOptions ] - [-MaxConcurrentSessions ] [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-InMemory] [-Force] + [-MaxConcurrentSessions ] [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-GatewaySiteLbrEnabled ] [-InMemory] [-Force] [-WhatIf] [-Confirm] [] ``` @@ -260,6 +260,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -GatewaySiteLbrEnabled +Used to enable this SBC to report assigned site location. Site location is used for Location Based Routing. When this parameter is turned on, the SBC will report the site name as defined by tenant administrator. On incoming call to a Teams user the value of the site assigned to the SBC is compared with the value of the site assigned to the user to make a routing decision. The parameter is mandatory for enabling Location Based Routing feature. The default value is False ($False). + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: +Applicable: Skype for Business Online +Required: False +Position: Named +Default value: $false +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -SendSipOptions Defines if an SBC will or will not send the SIP options. If disabled, the SBC will be excluded from Monitoring and Alerting system. We highly recommend that you enable SIP options. Default value is True. diff --git a/skype/skype-ps/skype/Set-CSOnlinePSTNGateway.md b/skype/skype-ps/skype/Set-CSOnlinePSTNGateway.md index 97a46c8162..090c3aded0 100644 --- a/skype/skype-ps/skype/Set-CSOnlinePSTNGateway.md +++ b/skype/skype-ps/skype/Set-CSOnlinePSTNGateway.md @@ -18,7 +18,7 @@ Modifies the previously defined Session Border Controller (SBC) Configuration th Set-CSOnlinePSTNGateway [-Tenant ] [-SipSignallingPort ] [-CodecPriority ] [-ExcludedCodecs ] [-FailoverTimeSeconds ] [-ForwardCallHistory ] [-ForwardPai ] [-SendSipOptions ] [-MaxConcurrentSessions ] - [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [[-Identity] ] [-Force] [-WhatIf] + [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-GatewaySiteLbrEnabled ] [[-Identity] ] [-Force] [-WhatIf] [-Confirm] [] ``` @@ -27,7 +27,7 @@ Set-CSOnlinePSTNGateway [-Tenant ] [-SipSignallingPort ] [-C Set-CSOnlinePSTNGateway [-Tenant ] [-SipSignallingPort ] [-CodecPriority ] [-ExcludedCodecs ] [-FailoverTimeSeconds ] [-ForwardCallHistory ] [-ForwardPai ] [-SendSipOptions ] [-MaxConcurrentSessions ] - [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-Instance ] [-Force] [-WhatIf] [-Confirm] + [-Enabled ] [-MediaBypass ] [-GatewaySiteId ] [-GatewaySiteLbrEnabled ] [-Instance ] [-Force] [-WhatIf] [-Confirm] [] ``` @@ -245,6 +245,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -GatewaySiteLbrEnabled +Used to enable this SBC to report assigned site location. Site location is used for Location Based Routing. When this parameter is turned on, the SBC will report the site name as defined by tenant administrator. On incoming call to a Teams user the value of the site assigned to the SBC is compared with the value of the site assigned to the user to make a routing decision. The parameter is mandatory for enabling Location Based Routing feature. The default value is False ($False). + +```yaml +Type: Boolean +Parameter Sets: (All) +Aliases: +Applicable: Skype for Business Online +Required: False +Position: Named +Default value: $false +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -SendSipOptions Defines if an SBC will or will not send the SIP options. If disabled, the SBC will be excluded from Monitoring and Alerting system. We highly recommend that you enable SIP options. Default value is True. diff --git a/skype/skype-ps/skype/Set-CsAuthConfig.md b/skype/skype-ps/skype/Set-CsAuthConfig.md index 7174b554f7..8917343dcc 100644 --- a/skype/skype-ps/skype/Set-CsAuthConfig.md +++ b/skype/skype-ps/skype/Set-CsAuthConfig.md @@ -38,10 +38,16 @@ It is only meant to be run at the global level (and not at the pool level), and ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Set-CsAuthConfig -BlockWindowsAuthExternally ``` -{{ Add example description here }} +This example forces all external clients to use MA but allows NTLM or Kerberos (for clients that don't support ADAL) to work internally. If your clients do support ADAL they will use MA internally. + +### Example 2 +PS C:\> Set-CsAuthConfig -BlockWindowsAuthExternallyAndModernAuthInternally + +This example blocks NTLM externally and MA internally. It forces all external clients to use MA, but allows all clients to use legacy authentication methods internally (even ADAL-capable clients). + ## PARAMETERS diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000000..ec82e41921 --- /dev/null +++ b/tools/README.md @@ -0,0 +1 @@ +This folder contains tools for working with cmdlets. \ No newline at end of file diff --git a/tools/microsoft-teams-generator-tool/.eslintrc b/tools/microsoft-teams-generator-tool/.eslintrc new file mode 100644 index 0000000000..764fb3b58c --- /dev/null +++ b/tools/microsoft-teams-generator-tool/.eslintrc @@ -0,0 +1,167 @@ +{ + "env": { + "node": true, + "es6": true + }, + "plugins": [ + "security" + ], + "extends": [ + "eslint:recommended", + "plugin:node/recommended", + "plugin:security/recommended" + ], + "parserOptions": { + "ecmaVersion": 2018 + }, + "ecmaFeatures": { + "arrowFunctions": true, + "blockBindings": true, + "classes": true, + "defaultParameters": true, + "destructuring": true, + "forOf": true, + "generators": true, + "modules": true, + "objectLiteralComputedProperties": true, + "objectLiteralDuplicateProperties": true, + "objectLiteralShorthandMethods": true, + "objectLiteralShorthandProperties": true, + "regexUFlag": true, + "regexYFlag": true, + "restParams": true, + "spread": true, + "superInFunctions": true, + "templateStrings": true, + "unicodeCodePointEscapes": true, + "globalReturn": true + }, + "rules": { + "comma-dangle": [ 2, "never" ], + "no-console": 1, + "no-constant-condition": 2, + "no-control-regex": 2, + "no-debugger": 1, + "no-dupe-keys": 2, + "no-duplicate-case": 2, + "no-empty-character-class": 2, + "no-empty": 2, + "no-extra-boolean-cast": 2, + "no-extra-semi": 2, + "no-func-assign": 2, + "no-inner-declarations": 2, + "no-invalid-regexp": 2, + "no-irregular-whitespace": 2, + "no-negated-in-lhs": 2, + "no-unreachable": 2, + "use-isnan": 2, + "valid-typeof": 2, + + "accessor-pairs": 2, + "block-scoped-var": 2, + "curly": 2, + "default-case": 2, + "dot-location": [ 2, "property" ], + "dot-notation": 2, + "eqeqeq": [ 2, "smart" ], + "no-alert": 1, + "no-caller": 2, + "no-case-declarations": 2, + "no-div-regex": 1, + "no-else-return": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-fallthrough": 2, + "no-floating-decimal": 2, + "no-implied-eval": 2, + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-multi-spaces": 2, + "no-multi-str": 2, + "no-native-reassign": 2, + "no-new-func": 2, + "no-new-wrappers": 2, + "no-new": 2, + "no-octal-escape": 2, + "no-octal": 2, + "no-param-reassign": 2, + "no-proto": 2, + "no-redeclare": 2, + "no-return-assign": 2, + "no-self-compare": 2, + "no-throw-literal": 2, + "no-unused-expressions": [ 2, { "allowShortCircuit": true } ], + "no-useless-call": 2, + "no-useless-concat": 2, + "no-void": 2, + "no-warning-comments": 1, + "no-with": 2, + "radix": [ 2, "as-needed" ], + "vars-on-top": 2, + "wrap-iife": [ 2, "inside" ], + "yoda": 2, + + "no-catch-shadow": 2, + "no-delete-var": 2, + "no-shadow-restricted-names": 2, + "no-shadow": 2, + "no-undef-init": 2, + "no-unused-vars": 2, + "no-use-before-define": 2, + + "global-require": 2, + "handle-callback-err": 1, + "no-new-require": 2, + + "no-duplicate-imports": "error", + "sort-imports": "error", + "block-spacing": [ 2, "always" ], + "brace-style": [ 2, "1tbs", { "allowSingleLine": false } ], + "camelcase": [ 2, { "properties": "always" } ], + "comma-spacing": [ 2, { "before": false, "after": true } ], + "comma-style": [ 2, "last" ], + "consistent-this": [ 2, "self" ], + "eol-last": 2, + "func-style": [ 2, "expression" ], + "key-spacing": [ 2, { "beforeColon": false, "afterColon": true } ], + "new-parens": 2, + "newline-after-var": [ 2, "always" ], + "no-array-constructor": 2, + "no-bitwise": 2, + "no-lonely-if": 2, + "no-mixed-spaces-and-tabs": 2, + "no-multiple-empty-lines": [ 2, { "max": 2, "maxEOF": 1 } ], + "no-nested-ternary": 2, + "no-new-object": 2, + "no-spaced-func": 2, + "no-trailing-spaces": [ 2, { "skipBlankLines": true } ], + "no-unneeded-ternary": 2, + "object-curly-spacing": [ 2, "always" ], + "operator-linebreak": [ 2, "none" ], + "semi": [ 2, "always" ], + "spaced-comment": [ 2, "always" ], + + "arrow-parens": [ 2, "always" ], + "arrow-spacing": 2, + "constructor-super": 2, + "generator-star-spacing": [ 2, { "before": true, "after": false } ], + "no-class-assign": 2, + "no-const-assign": 2, + "no-dupe-class-members": 2, + "no-this-before-super": 2, + "no-var": 2, + "prefer-arrow-callback": 1, + "prefer-spread": 1, + "prefer-template": 1, + "require-yield": 2, + "node/exports-style": ["error", "module.exports"], + "node/prefer-global/buffer": ["error", "always"], + "node/prefer-global/console": ["error", "always"], + "node/prefer-global/process": ["error", "always"], + "node/prefer-global/url-search-params": ["error", "always"], + "node/prefer-global/url": ["error", "always"] + } +} diff --git a/tools/microsoft-teams-generator-tool/.gitignore b/tools/microsoft-teams-generator-tool/.gitignore new file mode 100644 index 0000000000..a184e0a383 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/.gitignore @@ -0,0 +1,71 @@ +# Created by .ignore support plugin (hsz.mobi) +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# next.js build output +.next +package-lock.json +.idea/ +temp/* +templates/* + +results/ + +database/ diff --git a/tools/microsoft-teams-generator-tool/.prettierrc b/tools/microsoft-teams-generator-tool/.prettierrc new file mode 100644 index 0000000000..d6f735d480 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/.prettierrc @@ -0,0 +1,7 @@ +{ + "useTabs": true, + "tabWidth": 4, + "singleQuote": true, + "bracketSpacing": true, + "arrowParens": "always" +} diff --git a/tools/microsoft-teams-generator-tool/README.md b/tools/microsoft-teams-generator-tool/README.md new file mode 100644 index 0000000000..ae4d1a25c5 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/README.md @@ -0,0 +1,2 @@ +# microsoft-teams-generator-tool + diff --git a/tools/microsoft-teams-generator-tool/config/default.json b/tools/microsoft-teams-generator-tool/config/default.json new file mode 100644 index 0000000000..8fb828d5c0 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/config/default.json @@ -0,0 +1,15 @@ +{ + "platyPS": { + //"docPath": "D:\\Projects\\Microsoft\\office-docs-powershell\\sharepoint\\sharepoint-ps\\sharepoint-online" + "docPath": "D:\\Projects\\Microsoft\\office-docs-powershell\\teams\\teams-ps\\teams" + //"docPath": "D:\\Projects\\Microsoft\\office-docs-powershell\\skype\\skype-ps\\skype" + }, + "sendgrid": { + "apiKey": "", + "emailSettings": { + "from": "no-replay@outlook.com", + "to": "test@gmail.com", + "subject": "Test subject" + } +} +} diff --git a/tools/microsoft-teams-generator-tool/constants/commands.js b/tools/microsoft-teams-generator-tool/constants/commands.js new file mode 100644 index 0000000000..aaad2c7d23 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/constants/commands.js @@ -0,0 +1,8 @@ +module.exports = { + GET_TEAM: 'Get-Team', + INSTALL_MICROSOFT_TEAM: 'Install-Module MicrosoftTeams -SkipPublisherCheck', + CONNECT_MICROSOFT_TEAM: 'Connect-MicrosoftTeams', + INSTALL_PLATYPS: 'Install-Module -Name platyPS -Scope CurrentUser', + IMPORT_PLATYPS: 'Import-Module platyPS', + UPDATE_MARKDOWN: 'Update-MarkdownHelp -Path "{}" -LogPath "{}"' +}; diff --git a/tools/microsoft-teams-generator-tool/constants/errors.js b/tools/microsoft-teams-generator-tool/constants/errors.js new file mode 100644 index 0000000000..ab2652b1e2 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/constants/errors.js @@ -0,0 +1,20 @@ +module.exports.powerShellErrors = { + DOC_PATH_DOESNT_EXIST: "Path to documentation folder doesn't exist", + INSTALL_PLATYPS_ERROR: "Can't install 'platyPS' module", + IMPORT_PLATYPS_ERROR: "Cant't import 'platyPS' module", + INSTALL_MICROSOFT_TEAM_ERROR: "Can't install 'Microsoft team' module", + AUTH_MICROSOFT_TEAM_ERROR: "Can't auth into 'Microsoft team'" +}; + +module.exports.markdownErrors = { + CANT_CREATE_TEMP_FOLDER: "Can't create temp folder", + CANT_COPY_MD_FILE: "Can't copy markdown file into temp folder", + CANT_OPEN_LOG_FILE: "Can't open log file" +}; + +module.exports.mailErrors = { + CANT_GET_SENDGRID_API_KEY: 'Sendgrid api key is empty', + CANT_GET_MAIL_TO: 'Mail to is empty in config file', + CANT_GET_MAIL_FROM: 'Mail from is empty in config file', + CANT_GET_MAIL_SUBJECT: 'Mail subject is empty in config file' +}; diff --git a/tools/microsoft-teams-generator-tool/controllers/markdown.controller.js b/tools/microsoft-teams-generator-tool/controllers/markdown.controller.js new file mode 100644 index 0000000000..481ed370fb --- /dev/null +++ b/tools/microsoft-teams-generator-tool/controllers/markdown.controller.js @@ -0,0 +1,35 @@ +const fs = require('fs-extra'); +const of = require('await-of').default; +const { powerShellErrors } = require('../constants/errors'); + +class MarkdownController { + constructor(powerShellService, markdownService, config) { + this.powerShellService = powerShellService; + this.markdownService = markdownService; + this.config = config; + } + + async updateMarkdown() { + let err; + const { docPath } = this.config.get('platyPS'); + + if (!await fs.pathExists(docPath)) { + throw new Error(powerShellErrors.DOC_PATH_DOESNT_EXIST); + } + + [, err] = await of(this.powerShellService.preInstall()); + + if (err) { + throw new Error(err); + } + + [, err] = await of(this.markdownService.updateMd(docPath)); + + if (err) { + this.powerShellService.dispose(); + throw new Error(err); + } + } +} + +module.exports = MarkdownController; diff --git a/tools/microsoft-teams-generator-tool/db/index.js b/tools/microsoft-teams-generator-tool/db/index.js new file mode 100644 index 0000000000..4b407bbb44 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/db/index.js @@ -0,0 +1,10 @@ +const low = require('lowdb'); +const Memory = require('lowdb/adapters/Memory'); + +module.exports = () => { + const db = low(new Memory()); + + db.defaults({ logs: [] }).write(); + + return db; +}; diff --git a/tools/microsoft-teams-generator-tool/helpers/di.container.js b/tools/microsoft-teams-generator-tool/helpers/di.container.js new file mode 100644 index 0000000000..acafa11bdd --- /dev/null +++ b/tools/microsoft-teams-generator-tool/helpers/di.container.js @@ -0,0 +1,37 @@ +const awilix = require('awilix'); +const config = require('config'); +const PowerShellService = require('../services/power.shell.service'); +const MarkdownService = require('../services/markdown.service'); +const LogStoreService = require('../services/log.store.service'); +const LogParseService = require('../services/log.parse.service'); +const MailNotificationService = require('../services/mail.notification.service'); +const MarkdownController = require('../controllers/markdown.controller'); +const db = require('../db')(); + +module.exports = () => { + const container = awilix.createContainer({ + injectionMode: awilix.InjectionMode.CLASSIC, + lifetime: awilix.Lifetime.SINGLETON + }); + + container.register({ + config: awilix.asValue(config), + db: awilix.asValue(db) + }); + + container.register({ + mailNotificationService: awilix + .asClass(MailNotificationService) + .singleton(), + logStoreService: awilix.asClass(LogStoreService).singleton(), + logParseService: awilix.asClass(LogParseService).singleton(), + powerShellService: awilix.asClass(PowerShellService).singleton(), + markdownService: awilix.asClass(MarkdownService).singleton() + }); + + container.register({ + markdownController: awilix.asClass(MarkdownController).singleton() + }); + + return container; +}; diff --git a/tools/microsoft-teams-generator-tool/index.js b/tools/microsoft-teams-generator-tool/index.js new file mode 100644 index 0000000000..fe37e353f9 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/index.js @@ -0,0 +1,11 @@ +const container = require('./helpers/di.container')(); + +(async function() { + try { + const markdownController = container.resolve('markdownController'); + + await markdownController.updateMarkdown(); + } catch (e) { + console.log(e); + } +})(); diff --git a/tools/microsoft-teams-generator-tool/package.json b/tools/microsoft-teams-generator-tool/package.json new file mode 100644 index 0000000000..f6332c1b1b --- /dev/null +++ b/tools/microsoft-teams-generator-tool/package.json @@ -0,0 +1,37 @@ +{ + "name": "microsoft-teams-generator-tool", + "version": "1.0.0", + "engines": { + "node": ">=9.0.0" + }, + "description": "", + "main": "index.js", + "scripts": { + "start": "npm run app", + "app": "node index.js", + "app-dev": "nodemon npm run app", + "app-debug": "ndb npm run app", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "license": "ISC", + "devDependencies": { + "eslint": "^5.6.0", + "eslint-plugin-node": "^7.0.1", + "eslint-plugin-security": "^1.4.0", + "ndb": "^1.0.25", + "nodemon": "^1.18.4", + "prettier": "^1.14.2" + }, + "dependencies": { + "@sendgrid/mail": "^6.3.1", + "await-of": "^1.1.2", + "awilix": "^3.0.9", + "better-queue": "^3.8.10", + "config": "^2.0.1", + "fs-extra": "^7.0.0", + "lowdb": "^1.0.0", + "node-powershell": "^3.3.1", + "shortid": "^2.2.13", + "string-format": "^2.0.0" + } +} diff --git a/tools/microsoft-teams-generator-tool/services/log.parse.service.js b/tools/microsoft-teams-generator-tool/services/log.parse.service.js new file mode 100644 index 0000000000..19b49a05ea --- /dev/null +++ b/tools/microsoft-teams-generator-tool/services/log.parse.service.js @@ -0,0 +1,137 @@ +class LogParseService { + constructor(logStoreService, mailNotificationService, config) { + this.logStoreService = logStoreService; + this.mns = mailNotificationService; + this.config = config; + + this.noChangeValue = '__AllParameterSets'; + this.titleKeyword = { + value: 'UPDATING Cmdlet ', + displayName: 'UPDATING Cmdlet' + }; + this.keywords = [ + this.titleKeyword, + { + value: 'Parameter Added', + displayName: 'Parameter Added' + }, + { + value: 'Parameter Deleted', + displayName: 'Parameter Deleted' + }, + { + value: 'Parameter Updated', + displayName: 'Parameter Updated' + }, + { + value: 'Parameter Set Added', + displayName: 'Parameter Set Added' + }, + { + value: 'Parameter Set Deleted', + displayName: 'Parameter Set Deleted' + }, + { + value: 'Parameter Set Name Updated', + displayName: 'Parameter Set Name Updated' + } + ]; + } + + parseAll() { + const logs = this.logStoreService.getAll(); + const logObjs = []; + + logs.forEach((log) => { + const logObj = this.parse(log); + + logObjs.push(logObj); + }); + + const msg = this.generateMailText(logObjs); + + if (msg) { + const outputText = msg.replace(new RegExp('
', 'g'), '\n'); + + console.log(`\n\n${outputText}`); + + this.sendLogByEmailIfNeeded(msg); + } else { + const { docPath } = this.config.get('platyPS'); + + console.log(`In folder '${docPath}' didn't found any changes`); + } + } + + parse(log) { + const logObj = {}; + + this.keywords.forEach(({ value }) => { + const regex = new RegExp(`\t*(?<=${value}: ).*?(?=\\s)`, 'gi'); + const values = log.match(regex); + + logObj[value.trim()] = values ? values.join(', ') : ''; + }); + + return logObj; + } + + generateMailText(logObjs) { + const logsContent = []; + + logObjs.forEach((log) => { + let mailText = '', + isMailHasContent; + + for (const key in log) { + if (!log.hasOwnProperty(key)) { + continue; + } + + const value = log[key]; + + const isContent = value === this.noChangeValue || value === ''; + const isTitle = key === this.titleKeyword.value.trim(); + + if (isContent) { + continue; + } + + if (isTitle) { + const title = value.split(',')[0]; + + mailText += `File: ${title}
`; + continue; + } + + const { displayName } = this.keywords.find( + (kw) => kw.value === key + ); + + isMailHasContent = true; + mailText += `${displayName || key}: ${value}
`; + } + + if (isMailHasContent) { + logsContent.push(mailText); + } + }); + + return logsContent.join('

'); + } + + sendLogByEmailIfNeeded(text) { + const { to, from, subject } = this.config.get('sendgrid.emailSettings'); + + const msg = { + html: text, + to, + from, + subject + }; + + this.mns.addEmailToQueue(msg); + } +} + +module.exports = LogParseService; diff --git a/tools/microsoft-teams-generator-tool/services/log.store.service.js b/tools/microsoft-teams-generator-tool/services/log.store.service.js new file mode 100644 index 0000000000..9be0b5a35c --- /dev/null +++ b/tools/microsoft-teams-generator-tool/services/log.store.service.js @@ -0,0 +1,18 @@ +class LogStoreService { + constructor(db) { + this.db = db; + } + + add(log) { + this.db + .get('logs') + .push(log) + .write(); + } + + getAll() { + return this.db.get('logs').value(); + } +} + +module.exports = LogStoreService; diff --git a/tools/microsoft-teams-generator-tool/services/mail.notification.service.js b/tools/microsoft-teams-generator-tool/services/mail.notification.service.js new file mode 100644 index 0000000000..92179bf73f --- /dev/null +++ b/tools/microsoft-teams-generator-tool/services/mail.notification.service.js @@ -0,0 +1,52 @@ +const Queue = require('better-queue'); +const sgMail = require('@sendgrid/mail'); +const { mailErrors } = require('../constants/errors'); +const of = require('await-of').default; + +class MailNotificationService { + constructor(logStoreService, config) { + const apiKey = config.get('sendgrid.apiKey'); + + if (!apiKey) { + throw new Error(mailErrors.CANT_GET_SENDGRID_API_KEY); + } + + const { from, to, subject } = config.get('sendgrid.emailSettings'); + + if (!from) { + throw new Error(mailErrors.CANT_GET_MAIL_FROM); + } + + if (!to) { + throw new Error(mailErrors.CANT_GET_MAIL_TO); + } + + if (!subject) { + throw new Error(mailErrors.CANT_GET_MAIL_SUBJECT); + } + + sgMail.setApiKey(apiKey); + this.sgMail = sgMail; + + this.sendEmail = this.sendEmail.bind(this); + this.addEmailToQueue = this.addEmailToQueue.bind(this); + + this.queue = new Queue(this.sendEmail); + } + + addEmailToQueue(mail) { + this.queue.push(mail); + } + + async sendEmail(input, cb) { + const [result, err] = await of(this.sgMail.send(input)); + + if (err) { + cb(err, null); + } + + cb(null, result); + } +} + +module.exports = MailNotificationService; diff --git a/tools/microsoft-teams-generator-tool/services/markdown.service.js b/tools/microsoft-teams-generator-tool/services/markdown.service.js new file mode 100644 index 0000000000..30da02c496 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/services/markdown.service.js @@ -0,0 +1,150 @@ +const fs = require('fs-extra'); +const path = require('path'); +const Queue = require('better-queue'); +const of = require('await-of').default; +const shortId = require('shortid'); +const { markdownErrors } = require('../constants/errors'); + +class MarkdownService { + constructor(powerShellService, logStoreService, logParseService, config) { + this.logStoreService = logStoreService; + this.powerShellService = powerShellService; + this.logParseService = logParseService; + this.config = config; + + this.processQueue = this.processQueue.bind(this); + this.copyMdInTempFolder = this.copyMdInTempFolder.bind(this); + this.getLogFileContent = this.getLogFileContent.bind(this); + this.queueFinishHandler = this.queueFinishHandler.bind(this); + this.updateMd = this.updateMd.bind(this); + this.addMdFilesInQueue = this.addMdFilesInQueue.bind(this); + this.queueEmptyHandler = this.queueEmptyHandler.bind(this); + this.queueFailedHandler = this.queueFailedHandler.bind(this); + + this.queue = new Queue(this.processQueue); + this.queue.on('empty', this.queueEmptyHandler); + + this.tempFolderPath = null; + } + + async updateMd(docPath) { + this.tempFolderPath = `${docPath}\\${shortId()}`; + + await this.addMdFilesInQueue(docPath); + } + + async addMdFilesInQueue(folderPath) { + const mdExt = '.md'; + + const allFiles = await fs.readdir(folderPath); + const mdFiles = allFiles.filter((fileName) => fileName.endsWith(mdExt)); + + mdFiles.forEach((fileName) => { + const absolutePath = path.resolve(`${folderPath}\\${fileName}`); + + this.queue + .push(absolutePath) + .on('failed', this.queueFailedHandler) + .on('finish', this.queueFinishHandler); + }); + } + + async processQueue(input, cb) { + let result, err; + const logFilePath = `${this.tempFolderPath}\\${shortId()}.log`; + + [result, err] = await of( + this.copyMdInTempFolder(input, this.tempFolderPath) + ); + + if (err) { + return cb(err, null); + } + + [result, err] = await of( + this.powerShellService.updateMarkdown(result, logFilePath) + ); + + if (err) { + console.error(err); + + return cb(null, ''); + } + + console.log(result); // print powershell command result + + [result, err] = await of(this.getLogFileContent(logFilePath)); + + console.log(result); // print update file log + + if (err) { + return cb(err, null); + } + + [, err] = await of(this.clearTempFolder()); + + if (err) { + return cb(err, null); + } + + return cb(null, result); + } + + async queueFailedHandler(err) { + const [, fsError] = await of(this.clearTempFolder()); + + throw new Error(fsError || err); + } + + queueFinishHandler(result) { + if (!result) { + return; + } + this.logStoreService.add(result); + } + + queueEmptyHandler() { + this.powerShellService.dispose(); + + this.logParseService.parseAll(); + } + + async copyMdInTempFolder(srcFilePath, tempFolderPath) { + let err; + + const fileName = path.basename(srcFilePath); + const distFilePath = `${tempFolderPath}\\${fileName}`; + + [, err] = await of(fs.ensureDir(tempFolderPath)); + + if (err) { + throw new Error(markdownErrors.CANT_CREATE_TEMP_FOLDER); + } + + [, err] = await of(fs.copy(srcFilePath, distFilePath)); + + if (err) { + throw new Error(markdownErrors.CANT_COPY_MD_FILE); + } + + return distFilePath; + } + + async getLogFileContent(logFilePath) { + let err, result; + + [result, err] = await of(fs.ensureFile(logFilePath)); + + if (result || err) { + throw new Error(markdownErrors.CANT_OPEN_LOG_FILE); + } + + return (await fs.readFile(logFilePath)).toString(); + } + + async clearTempFolder() { + return await fs.remove(this.tempFolderPath); + } +} + +module.exports = MarkdownService; diff --git a/tools/microsoft-teams-generator-tool/services/power.shell.service.js b/tools/microsoft-teams-generator-tool/services/power.shell.service.js new file mode 100644 index 0000000000..8244eb5605 --- /dev/null +++ b/tools/microsoft-teams-generator-tool/services/power.shell.service.js @@ -0,0 +1,134 @@ +const Shell = require('node-powershell'); +const of = require('await-of').default; +const { powerShellErrors } = require('../constants/errors'); +const commands = require('../constants/commands'); +const format = require('string-format'); + +class PowerShellService { + constructor(config) { + this.config = config; + this.ps = new Shell({ + executionPolicy: 'Bypass', + noProfile: true + }); + } + + async preInstall() { + let output, err, result; + + [output, err] = await of(this.installPlatyPsIfNeeded()); + + if (err) { + await this.dispose(); + throw new Error(err); + } + + result += output; + + [output, err] = await of(this.authIfNeeded()); + + if (err) { + await this.dispose(); + throw new Error(err); + } + + result += output; + + return result; + } + + async authIfNeeded() { + let output, err, result; + + // const checkAuthCommand = commands.GET_TEAM; + // + // [output, err] = await of(this.invokeCommand(checkAuthCommand)); + // + // result += output; + // TODO: check if user already auth + + const installModule = commands.INSTALL_MICROSOFT_TEAM; + + [output, err] = await of(this.invokeCommand(installModule)); + + result += output; + + if (err) { + throw new Error(powerShellErrors.INSTALL_MICROSOFT_TEAM_ERROR); + } + + const auth = commands.CONNECT_MICROSOFT_TEAM; + + [output, err] = await of(this.invokeCommand(auth)); + + result += output; + + if (err) { + throw new Error(powerShellErrors.AUTH_MICROSOFT_TEAM_ERROR); + } + + return result; + } + + async installPlatyPsIfNeeded() { + let output, + err, + result = ''; + + const installModule = commands.INSTALL_PLATYPS; + + [output, err] = await of(this.invokeCommand(installModule)); + + if (err) { + throw new Error(powerShellErrors.INSTALL_PLATYPS_ERROR); + } + + result += output; + + const importModule = commands.IMPORT_PLATYPS; + + [output, err] = await of(this.invokeCommand(importModule)); + + if (err) { + throw new Error(powerShellErrors.IMPORT_PLATYPS_ERROR); + } + + result += output; + + return result; + } + + async updateMarkdown(docPath, logPath) { + const command = this.createUpdateMarkdownCommand(docPath, logPath); + + const [output, err] = await of(this.invokeCommand(command)); + + if (err) { + throw new Error(err); + } + + return output; + } + + createUpdateMarkdownCommand(docPath, logPath) { + return format(commands.UPDATE_MARKDOWN, docPath, logPath); + } + + async invokeCommand(command) { + await this.ps.addCommand(command); + + const [output, err] = await of(this.ps.invoke()); + + if (err) { + throw new Error(err); + } + + return output; + } + + async dispose() { + return await this.ps.dispose(); + } +} + +module.exports = PowerShellService;