The term 'New-MailContact' is not recognized as the name of a cmdlet

0

cześć, próbuję zaimportować kontakty do o365 za pomocą polecenia:

Import-Csv .\tylkoaliasy.csv | ForEach {New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName $_.FirstName -LastName $_.LastName}

jednak podczas importu z użyciem ww. cmdlet dostaję takie info:

New-MailContact : The term 'New-MailContact' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
 a path was included, verify that the path is correct and try again.
At line:1 char:41
+ Import-Csv .\tylkoaliasy.csv | ForEach {New-MailContact -Name $_.Name ...
+                                         ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-MailContact:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

jak to rozwiązać?

1

Zainstalowałeś:
Install-Module -Name AzureAD
Na pewno masz połączenie do maszyny z Office365?

0

AzureAD zainstalowane
gdy robie get-msoluser -all dostaję info o skrzynkach więc podłączony jestem...

0

A jak dodasz kontakt ręcznie bez CSV? Też masz taki komunikat? Nie mam niestety w domu nic z Exchenge żeby przetestować.

0

chętnie spr. ale jak powinno wyglądać takie polecenie?

0

to samo:

PS C:\WINDOWS\system32> New-MailContact -Name "Chris Ashton" -ExternalEmailAddress "[email protected]"
New-MailContact : The term 'New-MailContact' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
 a path was included, verify that the path is correct and try again.
At line:1 char:1
+ New-MailContact -Name "Chris Ashton" -ExternalEmailAddress "chris@tai ...
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (New-MailContact:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

1 użytkowników online, w tym zalogowanych: 0, gości: 1