Question Exchange Powershell core et PHP

Plus d'informations
il y a 4 ans 9 mois #29041 par Gilles LELEU
Bonjour
Voici mon problème sur un serveur Debian j'ai installé Powershell et j'ai fais un script pour créer un utilisateur exchange

[code:1]#!/usr/bin/env pwsh

$Nom = $args[0]
$Prenom = $args[1]
$Identifiant = $args[2]


New-mailbox -Name \"$Nom $Prenom\" -Lastname $Nom -FirstName $Prenom -DisplayName \"$Nom $Prenom\" -Alias $Identifiant -UserPrincipalName \"$Identifiant@toto.fr\" -PrimarySmtpAddress \"$Identifiant@toto.fr\" -Password (ConvertTo-SecureString -String \"Bienvenue2018\" -AsPlainText -Force)[/code:1]
j'ai ceci comme message d'erreur

new-mailbox : The term 'new-mailbox' 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-mailbox
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (new-mailbox:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException


sachant que le commande new-mailbox et bien une commande de powershell!

Merci de votre aide

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 9 mois #29043 par Laurent Dardenne
Salut,
alf78fr écrit:

sachant que le commande new-mailbox et bien une commande de powershell!

C'est une bien une commande Powershell mais livrée avec Exchange si tu n'as pas le module, tu ne peux utiliser ce cmdlet et sous Linux je ne pense pas que cela fonctionnera en local, mais peut être en remote implicite .

Tutoriels PowerShell

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 8 mois #29120 par Quentin
Réponse de Quentin sur le sujet Re:Exchange Powershell core et PHP
Bonjour,

Essaie d'ouvrir une PSSession vers ton serveur Exchange.

Puis tu fais :

[code:1]
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
Import-PSSession $Session
[/code:1]

Après il y a des possibilités de double-hop avec les deux Pssession donc pas sûr que ça fonctionne.

Whitatrax

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.079 secondes
Propulsé par Kunena