Question Exchange Powershell core et PHP
- Gilles LELEU
- Auteur du sujet
- Hors Ligne
- Nouveau membre
Réduire
Plus d'informations
- Messages : 18
- Remerciements reçus 0
il y a 5 ans 6 mois #29041
par Gilles LELEU
Exchange Powershell core et PHP a été créé 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
sachant que le commande new-mailbox et bien une commande de powershell!
Merci de votre aide
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.
- Laurent Dardenne
- Hors Ligne
- Modérateur
Réduire
Plus d'informations
- Messages : 6302
- Remerciements reçus 68
il y a 5 ans 6 mois #29043
par Laurent Dardenne
Tutoriels PowerShell
Réponse de Laurent Dardenne sur le sujet Re:Exchange Powershell core et PHP
Salut,
alf78fr écrit:
alf78fr écrit:
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 .sachant que le commande new-mailbox et bien une commande de powershell!
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- Quentin
- Hors Ligne
- Membre senior
Réduire
Plus d'informations
- Messages : 47
- Remerciements reçus 0
il y a 5 ans 5 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
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.105 secondes
- Vous êtes ici :
- Accueil
- forum
- PowerShell
- Entraide pour les initiés
- Exchange Powershell core et PHP