I'm a system admin at work and part of the day to day is creating new mailboxes for users in Office 365 and we are forced to use powershell to do this. The only variable in the PS commands is the user's email address however the script is split in two parts because we need to wait for some replication before completing the process.
So I would like to create a VB front end which I have designed but I don't know how to do the coding for it because I have no point of reference to copy if you see what I mean. This is my design which is very simple.
VB Design:

These are the PS commands I need to associate with the radio buttons;
Step 1
$credentials = get-credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://URL -Credential $credentials –AllowRedirection
Import-PSSession $Session
set-ADServerSettings -ViewEntireForest $true
Enable-RemoteMailbox -Identity [email protected] -RemoteRoutingAddress [email protected]
Enable-RemoteMailbox -Identity [email protected] -Archive
WAIT 3 HOURS
Step 2
$msolcred = get-credential
connect-msolservice -credential $msolcred
Set-MsolUser -UserPrincipalName [email protected] -UsageLocation GB
$LicOpt = New-MsolLicenseOptions -AccountSkuId company:STANDARDPACK -DisabledPlans MCOSTANDARD
Set-MsolUserLicense -UserPrincipalName [email protected] -AddLicenses company:STANDARDPACK -LicenseOptions $LicOpt
Remove-PSSession $Session
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 262
تاريخ: دوشنبه
10 خرداد
1395 ساعت: 5:16