13. August 2015 00:56
Enter-PSSession -computerName NAVSERVER1 -credential <domainname>\administratorImport-Module "C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1" -force | out-nullNew-NAVCompany -ServerInstance NAMENAVSERVICE1 -Tenant Default -CompanyName TEST123Exit-PSSession $cred = Get-Credential <domainname>\administrator
$MySession = New-PSSession -computerName NAVSERVER1 -credential $cred
invoke-command -Session $MySession -scriptblock {Import-Module "C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1" -force | out-null}
invoke-command -Session $MySession -scriptblock {New-NAVCompany -ServerInstance NAMENAVSERVICE1 -Tenant Default -CompanyName TEST123}
Remove-PSSession $MySession14. August 2015 11:00
invoke-command -Session $MySession -scriptblock {Sync-NAVTenant -ServerInstance NAMENAVSERVICE1 -Force -Mode Sync}$cred = Get-Credential <domainname>\administrator
$MySession = New-PSSession -computerName NAVSERVER1 -credential $cred
invoke-command -Session $MySession -scriptblock {Import-Module "C:\Program Files\Microsoft Dynamics NAV\71\Service\NavAdminTool.ps1" -force | out-null}
invoke-command -Session $MySession -scriptblock {Sync-NAVTenant -ServerInstance NAMENAVSERVICE1 -Force -Mode Sync}
invoke-command -Session $MySession -scriptblock {New-NAVCompany -ServerInstance NAMENAVSERVICE1 -Tenant Default -CompanyName TEST123}
Remove-PSSession $MySession15. Dezember 2015 11:38
"P@ssWord1" | ConvertTo-SecureString -AsPlainText -Force | Out-File "X:\Temp\Passwort.xxx"$User = '<domainname>\administrator'
$File = "X:\Temp\Passwort.xxx"
$cred = New-Object -TypeName System.Management.Automation.PSCredential ` -ArgumentList $User, (Get-Content $File | ConvertTo-SecureString)$cred = Get-Credential <domainname>\administrator15. Dezember 2015 13:09
"P@ssWord1" | ConvertTo-SecureString -key (1..16) -AsPlainText -Force | Out-File "X:\Temp\Passwort.xxx" Read-Host "Enter Password" -AsSecureString | ConvertTo-SecureString -key (1..16) -AsPlainText -Force | Out-File "X:\Temp\Passwort.xxx" $cred = New-Object -TypeName System.Management.Automation.PSCredential ` -ArgumentList $User, (Get-Content $File | ConvertTo-SecureString -key (1..16))