#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: SAPIEN Technologies PrimalForms (Community Edition) v1.0.7.0 # Generated On: 14/12/2009 10:08 # Generated By: ######################################################################## #region Import the Assemblies [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null #endregion #region Generated Form Objects $form1 = New-Object System.Windows.Forms.Form $panel1 = New-Object System.Windows.Forms.Panel $textBox19 = New-Object System.Windows.Forms.TextBox $textBox18 = New-Object System.Windows.Forms.TextBox $textBox17 = New-Object System.Windows.Forms.TextBox $textBox16 = New-Object System.Windows.Forms.TextBox $textBox15 = New-Object System.Windows.Forms.TextBox $textBox14 = New-Object System.Windows.Forms.TextBox $textBox13 = New-Object System.Windows.Forms.TextBox $textBox12 = New-Object System.Windows.Forms.TextBox $textBox11 = New-Object System.Windows.Forms.TextBox $textBox10 = New-Object System.Windows.Forms.TextBox $textBox9 = New-Object System.Windows.Forms.TextBox $textBox6 = New-Object System.Windows.Forms.TextBox $textBox5 = New-Object System.Windows.Forms.TextBox $textBox4 = New-Object System.Windows.Forms.TextBox $textBox3 = New-Object System.Windows.Forms.TextBox $textBox2 = New-Object System.Windows.Forms.TextBox $textBox8 = New-Object System.Windows.Forms.TextBox $textBox7 = New-Object System.Windows.Forms.TextBox $textBox1 = New-Object System.Windows.Forms.TextBox $label22 = New-Object System.Windows.Forms.Label $label20 = New-Object System.Windows.Forms.Label $label19 = New-Object System.Windows.Forms.Label $label18 = New-Object System.Windows.Forms.Label $label17 = New-Object System.Windows.Forms.Label $label16 = New-Object System.Windows.Forms.Label $label15 = New-Object System.Windows.Forms.Label $label14 = New-Object System.Windows.Forms.Label $label13 = New-Object System.Windows.Forms.Label $label12 = New-Object System.Windows.Forms.Label $label11 = New-Object System.Windows.Forms.Label $label10 = New-Object System.Windows.Forms.Label $label9 = New-Object System.Windows.Forms.Label $label8 = New-Object System.Windows.Forms.Label $label7 = New-Object System.Windows.Forms.Label $label6 = New-Object System.Windows.Forms.Label $label5 = New-Object System.Windows.Forms.Label $label4 = New-Object System.Windows.Forms.Label $label3 = New-Object System.Windows.Forms.Label $label2 = New-Object System.Windows.Forms.Label $listBox1 = New-Object System.Windows.Forms.ListBox $Button_Modifier_Nom = New-Object System.Windows.Forms.Button $progressBar1 = New-Object System.Windows.Forms.ProgressBar $label1 = New-Object System.Windows.Forms.Label $Recherche_Nom = New-Object System.Windows.Forms.TextBox $Button_Recherche_Nom = New-Object System.Windows.Forms.Button $Button_import = New-Object System.Windows.Forms.Button $InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState #endregion Generated Form Objects #---------------------------------------------- #Generated Event Script Blocks #---------------------------------------------- #Provide Custom Code for events specified in PrimalForms. $handler_textBox1_TextChanged= { } #$dataGrid1.DataSource = $dt.psObject.baseobject #} #} $handler_form1_Load= { #TODO: Place custom script here } $handler_Button_Recherche_Nom_Click= { $strFilter = "(&(objectCategory=User)(sn=" + $Recherche_Nom.text + "))" $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = $strFilter $colResults = $objSearcher.FindAll() #$listBox1.AutoSize = $True #$objListBox = New-Object System.Windows.Forms.ListBox $ListBox1.Items.Clear() foreach ($objResult in $colResults) { $nameAD = [string]$objResult.Properties.item("sAMAccountName") [void]$ListBox1.Items.Add($nameAD) #$objForm.Controls.Add($objListBox) #$objForm.Topmost = $True } } $handler_listBox1_SelectedValueChanged= { $Button_Modifier_Nom.Visible = $True $Panel1.Visible = $True #For ($i=0; $i=$ListBox1.ListCount; $i++) #{ # If ($ListBox1.SelectedValue =true ) # { # $NameofUser= $ListBox1.List(i) # } # #} $strFilter = "(&(objectCategory=User)(sAMAccountName=" + $ListBox1.SelectedItem + "))" $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = $strFilter $colResults = $objSearcher.FindAll() foreach ($objResult in $colResults) { $Textbox1.Text = [string]$objResult.Properties.item("sAMAccountName") $Textbox2.Text = [string]$objResult.Properties.item("sn") $Textbox3.Text = [string]$objResult.Properties.item("givenName") $Textbox4.Text = [string]$objResult.Properties.item("title") $Textbox5.Text = [string]$objResult.Properties.item("mail") $Textbox6.Text = [string]$objResult.Properties.item("telephoneNumber") $Textbox7.Text = [string]$objResult.Properties.item("facsimileTelephoneNumber") $Textbox8.Text = [string]$objResult.Properties.item("mobile") $Textbox9.Text = [string]$objResult.Properties.item("ipPhone") $Textbox10.Text = [string]$objResult.Properties.item("Department") $Textbox11.Text = [string]$objResult.Properties.item("company") $Textbox12.Text = [string]$objResult.Properties.item("StreetAddress") $Textbox13.Text = [string]$objResult.Properties.item("PostalCode") $Textbox14.Text = [string]$objResult.Properties.item("l") $Textbox15.Text = [string]$objResult.Properties.item("co") $Textbox16.Text = [string]$objResult.Properties.item("MemberOf") $Textbox17.Text = [string]$objResult.Properties.item("TSConnectClientDrives") $Textbox18.Text = [string]$objResult.Properties.item("TSConnectPrinterDrives") $Textbox19.Text = [string]$objResult.Properties.item("TSDefaultToMainPrinter") } } $Button_Modifier_Nom_OnClick= { $strFilter = "(&(objectCategory=User)(sAMAccountName=" + $ListBox1.SelectedItem + "))" $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 1000 $objSearcher.Filter = $strFilter $colResults = $objSearcher.FindAll() foreach ($objResult in $colResults) { $UserDN = [string]$objResult.Properties.item("distinguishedName") $objUser1="LDAP://adlvl02/" $objUser2 = $objUser1 + $UserDN $objUser = [ADSI]$objUser2 [bool]$OK = $false If ($Textbox1.get_text() -eq '') { $label2.ForeColor = "Red" $label22.Visible = $true } elseIf ($Textbox2.get_text() -eq '') { $label3.ForeColor = "Red" $label22.Visible = $true } elseIf ($Textbox3.get_text() -eq '') { $label4.ForeColor = "Red" $label22.Visible = $true } elseIf ($Textbox5.get_text() -eq '') { $label6.ForeColor = "Red" $label22.Visible = $true } else{$OK = $true} if ($OK -eq $true) { $sam = $null $sn = $null $givenName = $null $title = $null $mail = $null $telephoneNumber = $null $facsimileTelephoneNumber = $null $mobile = $null $ipPhone = $null $Department = $null $company = $null $StreetAddress = $null $PostalCode = $null $l = $null $co = $null $MemberOf = $null If ($Textbox4.get_text() -eq '') { $objUser.PutEx(1,"title",0) $objUser.SetInfo() } else{ $objUser.Put("title", $Textbox4.get_text()) $objUser.SetInfo() $title = $Textbox4.get_text() } If ($Textbox6.get_text() -eq '') { $objUser.PutEx(1,"telephoneNumber",0) $objUser.SetInfo() } else{ $objUser.Put("telephoneNumber", $Textbox6.get_text()) $objUser.SetInfo() $telephoneNumber = $Textbox6.get_text() } If ($Textbox7.get_text() -eq '') { $objUser.PutEx(1,"facsimileTelephoneNumber",0) $objUser.SetInfo() } else{ $objUser.Put("facsimileTelephoneNumber", $Textbox7.get_text()) $objUser.SetInfo() $facsimileTelephoneNumber = $Textbox7.get_text() } If ($Textbox8.get_text() -eq '') { $objUser.PutEx(1,"mobile",0) $objUser.SetInfo() } else{ $objUser.Put("mobile", $Textbox8.get_text()) $objUser.SetInfo() $mobile = $Textbox8.get_text() } If ($Textbox9.get_text() -eq '') { $objUser.PutEx(1,"ipPhone",0) $objUser.SetInfo() } else{ $objUser.Put("ipPhone", $Textbox9.get_text() ) $objUser.SetInfo() $ipPhone = $Textbox9.get_text() } If ($Textbox10.get_text() -eq '') { $objUser.PutEx(1,"Department",0) $objUser.SetInfo() } else{ $objUser.Put("Department", $Textbox10.get_text()) $objUser.SetInfo() $Department = $Textbox10.get_text() } If ($Textbox11.get_text() -eq '') { $objUser.PutEx(1,"company",0) $objUser.SetInfo() } else{ $objUser.Put("company", $Textbox11.get_text()) $objUser.SetInfo() $company = $Textbox11.get_text() } If ($Textbox12.get_text() -eq '') { $objUser.PutEx(1,"StreetAddress",0) $objUser.SetInfo() } else{ $objUser.Put("StreetAddress", $Textbox12.get_text()) $objUser.SetInfo() $StreetAddress = $Textbox12.get_text() } If ($Textbox13.get_text() -eq '') { $objUser.PutEx(1,"PostalCode",0) $objUser.SetInfo() } else{ $objUser.Put("PostalCode", $Textbox13.get_text()) $objUser.SetInfo() $PostalCode = $Textbox13.get_text() } If ($Textbox14.get_text() -eq '') { $objUser.PutEx(1,"l",0) $objUser.SetInfo() } else{ $objUser.Put("l", $Textbox14.get_text()) $objUser.SetInfo() $l = $Textbox14.get_text() } If ($Textbox15.get_text() -eq '') { $objUser.PutEx(1,"co",0) $objUser.SetInfo() } else{ $objUser.Put("co", $Textbox15.get_text()) $objUser.SetInfo() $co = $Textbox15.get_text() } $objUser.Put("sAMAccountName", $Textbox1.get_text()) $objUser.Put("sn", $Textbox2.get_text()) $objUser.Put("givenName", $Textbox3.get_text()) $objUser.Put("mail", $Textbox5.get_text()) $objUser.SetInfo() $sam= $Textbox1.get_text() $sn = $Textbox2.get_text() $givenName = $Textbox3.get_text() $mail = $Textbox5.get_text() $label2.ForeColor = "ControlText" $label3.ForeColor = "ControlText" $label4.ForeColor = "ControlText" $label6.ForeColor = "ControlText" $label22.Visible = $false #******************************************************************************************************* $difff= " => Valeurs modifiees :" if ($sam -ne [string]$objResult.Properties.item("sAMAccountName")) { $difff = $difff + " sAMAccountName : -Ancien : " + [string]$objResult.Properties.item("sAMAccountName") + " -Nouveau : " +$sam + " *** " } if ($sn -ne [string]$objResult.Properties.item("sn")) { $difff = $difff + " sn : -Ancien : " + [string]$objResult.Properties.item("sn") + " -Nouveau :" +$sn + " *** " } if ($givenName -ne [string]$objResult.Properties.item("givenName")) { $difff = $difff + " givenName : -Ancien : " + [string]$objResult.Properties.item("givenName") + " -Nouveau : " +$givenName + " *** " } if ($title -ne [string]$objResult.Properties.item("title")) { $title2 = [string]$objResult.Properties.item("title") if ((!$title2) -and ($title -eq $null)) { } else { $difff = $difff + " title : -Ancien :" + [string]$objResult.Properties.item("title") + "-Nouveau :" +$title + " *** " } } if ($mail -ne [string]$objResult.Properties.item("mail")) { $difff = $difff + " mail : -Ancien : " + [string]$objResult.Properties.item("mail") + " -Nouveau : " +$mail + " *** " } if ($telephoneNumber -ne [string]$objResult.Properties.item("telephoneNumber")) { $telephoneNumber2 = [string]$objResult.Properties.item("telephoneNumber") if ((!$telephoneNumber2) -and ($telephoneNumber -eq $null)) { } else { $difff = $difff + " telephoneNumber : -Ancien : " + [string]$objResult.Properties.item("telephoneNumber") + " -Nouveau : " +$telephoneNumber + " *** " } } if ($facsimileTelephoneNumber -ne [string]$objResult.Properties.item("facsimileTelephoneNumber")) { $facsimileTelephoneNumber2 = [string]$objResult.Properties.item("facsimileTelephoneNumber") if ((!$facsimileTelephoneNumber2) -and ($facsimileTelephoneNumber -eq $null)) { } else { $difff = $difff + " fax : -Ancien : " + [string]$objResult.Properties.item("facsimileTelephoneNumber") + " -Nouveau : " +$facsimileTelephoneNumber + " *** " } } if ($mobile -ne [string]$objResult.Properties.item("mobile")) { $mobile2 = [string]$objResult.Properties.item("mobile") if ((!$mobile2) -and ($mobile -eq $null)) { } else { $difff = $difff + " mobile : -Ancien : " + [string]$objResult.Properties.item("mobile") + " -Nouveau : " +$mobile + " *** " } } if ($ipPhone -ne [string]$objResult.Properties.item("ipPhone")) { $ipPhone2 = [string]$objResult.Properties.item("ipPhone") if ((!$ipPhone2) -and ($ipPhone -eq $null)) { } else { $difff = $difff + " ipPhone : -Ancien : " + [string]$objResult.Properties.item("ipPhone") + " -Nouveau : " +$ipPhone + " *** " } } if ($Department -ne [string]$objResult.Properties.item("Department")) { $Department2 = [string]$objResult.Properties.item("Department") if ((!$Department2) -and ($Department -eq $null)) { } else { $difff = $difff + " Department : -Ancien : " + [string]$objResult.Properties.item("Department") + " -Nouveau : " +$Department + " *** " } } if ($company -ne [string]$objResult.Properties.item("company")) { $company2 = [string]$objResult.Properties.item("company") if ((!$company2) -and ($company -eq $null)) { } else { $difff = $difff + " company : -Ancien : " + [string]$objResult.Properties.item("company") + " -Nouveau : " +$company + " *** " } } if ($StreetAddress -ne [string]$objResult.Properties.item("StreetAddress")) { $StreetAddress2 = [string]$objResult.Properties.item("StreetAddress") if ((!$StreetAddress2) -and ($StreetAddress -eq $null)) { } else { $difff = $difff + " StreetAddress : -Ancien : " + [string]$objResult.Properties.item("StreetAddress") + " -Nouveau : " +$StreetAddress + " *** " } } if ($PostalCode -ne [string]$objResult.Properties.item("PostalCode")) { $PostalCode2 = [string]$objResult.Properties.item("PostalCode") if ((!$PostalCode2) -and ($PostalCode -eq $null)) { } else { $difff = $difff + " PostalCode : -Ancien : " + [string]$objResult.Properties.item("PostalCode") + " -Nouveau : " +$PostalCode + " *** " } } if ($l -ne [string]$objResult.Properties.item("l")) { $l2 = [string]$objResult.Properties.item("l") if ((!$l2) -and ($l -eq $null)) { } else { $difff = $difff + " Ville : -Ancien : " + [string]$objResult.Properties.item("l") + " -Nouveau : " +$l + " *** " } } if ($co -ne [string]$objResult.Properties.item("co")) { $co2 = [string]$objResult.Properties.item("co") if ((!$co2) -and ($co -eq $null)) { } else { $difff = $difff + " country : -Ancien : " + [string]$objResult.Properties.item("co") + " -Nouveau : " +$co + " *** " } } #******************************************************************************************************* #Export csv & xml $tableau = @() $NbLigne = 0 #$nametest = Import-Clixml -path "c:\extract.xml" #$Don = GWMI -Cl Win32_OperatingSystem #$Don.ConvertToDateTime($Don.LastBootUpTime) #$time = (get-date).ToString() #$nametest = $time + " " + $difff #$nametest | Export-Clixml -path "c:\extract.xml" $FileName="C:\testfile.csv" #Récupère les anciennes infos dans un tableau $OldRecord=import-Csv -path $FileName $mytab = "" | select sam,sn,givenName,title,mail,telephoneNumber,facsimileTelephoneNumber,mobile,ipPhone,Department,company,StreetAddress,PostalCode,l,co $mytab.sam = $sam $mytab.sn = $sn $mytab.givenName = $givenName $mytab.title = $title $mytab.mail = $mail $mytab.telephoneNumber = $telephoneNumber $mytab.facsimileTelephoneNumber = $facsimileTelephoneNumber $mytab.mobile = $mobile $mytab.ipPhone = $ipPhone $mytab.Department = $Department $mytab.company = $company $mytab.StreetAddress = $StreetAddress $mytab.PostalCode = $PostalCode $mytab.l = $l $mytab.co = $co $mytab | select sam,sn,givenName,title,mail,telephoneNumber,facsimileTelephoneNumber,mobile,ipPhone,Department,company,StreetAddress,PostalCode,l,co | Export-Csv -delimiter ";" -path C:\testfile.csv -NoTypeInformation $objUser | select sAMAccountName,sn | Export-Csv -delimiter ";" -path C:\objuser.csv -NoTypeInformation #Ajoute les nouvelles infos au tableau #$NewRecord=$OldRecord+$mytab #enregistre les nouvelles infos dans le fichier #$NewRecord|Export-Csv -path $FileName #Dir | Select Name,Length | ConvertTo-Csv -delimiter ";" -NoTypeInformation|Write-Warning } } } $Button_import_OnClick= { $import1 = Import-Csv -path C:\testfile.csv -OutVariable string foreach ($Line in $import1) { $this_mail = $Line.mail $this_sam = [string]$Line.sam $this_givenName = $Line.givenName $this_title = $Line.title } #$label1.Text = $import1 | $_.sn $label1.Text = $this_sam } $OnLoadForm_StateCorrection= {#Correct the initial state of the form to prevent the .Net maximized form issue $form1.WindowState = $InitialFormWindowState } #---------------------------------------------- #region Generated Form Code $form1.Text = "Active Directory" $form1.Name = "form1" $form1.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 784 $System_Drawing_Size.Height = 562 $form1.ClientSize = $System_Drawing_Size $form1.AutoSize = $True $form1.add_Load($handler_form1_Load) $listBox1.FormattingEnabled = $True $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 120 $System_Drawing_Size.Height = 95 $listBox1.Size = $System_Drawing_Size $listBox1.DataBindings.DefaultDataSourceUpdateMode = 0 $listBox1.Name = "listBox1" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 40 $System_Drawing_Point.Y = 143 $listBox1.Location = $System_Drawing_Point $listBox1.TabIndex = 6 $listBox1.add_SelectedIndexChanged($handler_listBox1_SelectedIndexChanged) $listBox1.add_SelectedValueChanged($handler_listBox1_SelectedValueChanged) $form1.Controls.Add($listBox1) $panel1.Visible = $False $panel1.TabIndex = 7 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 219 $System_Drawing_Point.Y = 128 $panel1.Location = $System_Drawing_Point $panel1.DataBindings.DefaultDataSourceUpdateMode = 0 $panel1.Name = "panel1" $panel1.AutoSize = $True $form1.Controls.Add($panel1) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox19.Size = $System_Drawing_Size $textBox19.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox19.Name = "textBox19" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 474 $textBox19.Location = $System_Drawing_Point $textBox19.TabIndex = 37 $panel1.Controls.Add($textBox19) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox18.Size = $System_Drawing_Size $textBox18.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox18.Name = "textBox18" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 447 $textBox18.Location = $System_Drawing_Point $textBox18.TabIndex = 36 $panel1.Controls.Add($textBox18) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox17.Size = $System_Drawing_Size $textBox17.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox17.Name = "textBox17" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 420 $textBox17.Location = $System_Drawing_Point $textBox17.TabIndex = 35 $panel1.Controls.Add($textBox17) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox16.Size = $System_Drawing_Size $textBox16.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox16.Name = "textBox16" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 393 $textBox16.Location = $System_Drawing_Point $textBox16.TabIndex = 34 $panel1.Controls.Add($textBox16) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox15.Size = $System_Drawing_Size $textBox15.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox15.Name = "textBox15" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 366 $textBox15.Location = $System_Drawing_Point $textBox15.TabIndex = 33 $panel1.Controls.Add($textBox15) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox14.Size = $System_Drawing_Size $textBox14.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox14.Name = "textBox14" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 339 $textBox14.Location = $System_Drawing_Point $textBox14.TabIndex = 32 $panel1.Controls.Add($textBox14) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox13.Size = $System_Drawing_Size $textBox13.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox13.Name = "textBox13" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 311 $textBox13.Location = $System_Drawing_Point $textBox13.TabIndex = 31 $panel1.Controls.Add($textBox13) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox12.Size = $System_Drawing_Size $textBox12.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox12.Name = "textBox12" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 284 $textBox12.Location = $System_Drawing_Point $textBox12.TabIndex = 30 $panel1.Controls.Add($textBox12) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox11.Size = $System_Drawing_Size $textBox11.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox11.Name = "textBox11" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 261 $textBox11.Location = $System_Drawing_Point $textBox11.TabIndex = 29 $panel1.Controls.Add($textBox11) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox10.Size = $System_Drawing_Size $textBox10.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox10.Name = "textBox10" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 234 $textBox10.Location = $System_Drawing_Point $textBox10.TabIndex = 28 $panel1.Controls.Add($textBox10) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox9.Size = $System_Drawing_Size $textBox9.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox9.Name = "textBox9" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 207 $textBox9.Location = $System_Drawing_Point $textBox9.TabIndex = 27 $panel1.Controls.Add($textBox9) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox6.Size = $System_Drawing_Size $textBox6.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox6.Name = "textBox6" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 131 $textBox6.Location = $System_Drawing_Point $textBox6.TabIndex = 26 $panel1.Controls.Add($textBox6) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox5.Size = $System_Drawing_Size $textBox5.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox5.Name = "textBox5" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 105 $textBox5.Location = $System_Drawing_Point $textBox5.TabIndex = 25 $textBox5.add_TextChanged($handler_textBox7_TextChanged) $panel1.Controls.Add($textBox5) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox4.Size = $System_Drawing_Size $textBox4.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox4.Name = "textBox4" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 79 $textBox4.Location = $System_Drawing_Point $textBox4.TabIndex = 24 $textBox4.add_TextChanged($handler_textBox6_TextChanged) $panel1.Controls.Add($textBox4) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox3.Size = $System_Drawing_Size $textBox3.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox3.Name = "textBox3" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 55 $textBox3.Location = $System_Drawing_Point $textBox3.TabIndex = 23 $panel1.Controls.Add($textBox3) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox2.Size = $System_Drawing_Size $textBox2.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox2.Name = "textBox2" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 32 $textBox2.Location = $System_Drawing_Point $textBox2.TabIndex = 22 $panel1.Controls.Add($textBox2) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox8.Size = $System_Drawing_Size $textBox8.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox8.Name = "textBox8" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 180 $textBox8.Location = $System_Drawing_Point $textBox8.TabIndex = 21 $panel1.Controls.Add($textBox8) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox7.Size = $System_Drawing_Size $textBox7.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox7.Name = "textBox7" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 157 $textBox7.Location = $System_Drawing_Point $textBox7.TabIndex = 20 $panel1.Controls.Add($textBox7) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $textBox1.Size = $System_Drawing_Size $textBox1.DataBindings.DefaultDataSourceUpdateMode = 0 $textBox1.Name = "textBox1" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 153 $System_Drawing_Point.Y = 8 $textBox1.Location = $System_Drawing_Point $textBox1.TabIndex = 19 $panel1.Controls.Add($textBox1) $label22.TabIndex = 0 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 15 $System_Drawing_Size.Height = 23 $label22.Size = $System_Drawing_Size $label22.Text = "Veuillez remplir les champs en rouge" $label22.ForeColor ="Red" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 350 $System_Drawing_Point.Y = 100 $label22.Location = $System_Drawing_Point $label22.DataBindings.DefaultDataSourceUpdateMode = 0 $label22.Name = "label22" $label22.Visible = $false $label22.Autosize = $true $form1.Controls.Add($label22) $label20.TabIndex = 18 $label20.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 23 $label20.Size = $System_Drawing_Size $label20.Text = "Printer default" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 474 $label20.Location = $System_Drawing_Point $label20.DataBindings.DefaultDataSourceUpdateMode = 0 $label20.Name = "label20" $panel1.Controls.Add($label20) $label19.TabIndex = 17 $label19.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 12 $label19.Size = $System_Drawing_Size $label19.Text = "Connect printer" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 447 $label19.Location = $System_Drawing_Point $label19.DataBindings.DefaultDataSourceUpdateMode = 0 $label19.Name = "label19" $label19.add_Click($handler_label19_Click) $panel1.Controls.Add($label19) $label18.TabIndex = 16 $label18.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 121 $System_Drawing_Size.Height = 15 $label18.Size = $System_Drawing_Size $label18.Text = "TSConnectClientDrives" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 420 $label18.Location = $System_Drawing_Point $label18.DataBindings.DefaultDataSourceUpdateMode = 0 $label18.Name = "label18" $label18.add_Click($handler_label18_Click) $panel1.Controls.Add($label18) $label17.TabIndex = 15 $label17.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label17.Size = $System_Drawing_Size $label17.Text = "MemberOf" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 393 $label17.Location = $System_Drawing_Point $label17.DataBindings.DefaultDataSourceUpdateMode = 0 $label17.Name = "label17" $label17.add_Click($handler_label17_Click) $panel1.Controls.Add($label17) $label16.TabIndex = 14 $label16.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label16.Size = $System_Drawing_Size $label16.Text = "Pays" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 366 $label16.Location = $System_Drawing_Point $label16.DataBindings.DefaultDataSourceUpdateMode = 0 $label16.Name = "label16" $panel1.Controls.Add($label16) $label15.TabIndex = 13 $label15.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 14 $label15.Size = $System_Drawing_Size $label15.Text = "Ville" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 339 $label15.Location = $System_Drawing_Point $label15.DataBindings.DefaultDataSourceUpdateMode = 0 $label15.Name = "label15" $panel1.Controls.Add($label15) $label14.TabIndex = 12 $label14.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 16 $label14.Size = $System_Drawing_Size $label14.Text = "Code Postale" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 311 $label14.Location = $System_Drawing_Point $label14.DataBindings.DefaultDataSourceUpdateMode = 0 $label14.Name = "label14" $panel1.Controls.Add($label14) $label13.TabIndex = 11 $label13.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 13 $label13.Size = $System_Drawing_Size $label13.Text = "Adresse" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 284 $label13.Location = $System_Drawing_Point $label13.DataBindings.DefaultDataSourceUpdateMode = 0 $label13.Name = "label13" $label13.add_Click($handler_label13_Click) $panel1.Controls.Add($label13) $label12.TabIndex = 10 $label12.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label12.Size = $System_Drawing_Size $label12.Text = "Société" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 261 $label12.Location = $System_Drawing_Point $label12.DataBindings.DefaultDataSourceUpdateMode = 0 $label12.Name = "label12" $label12.add_Click($handler_label12_Click) $panel1.Controls.Add($label12) $label11.TabIndex = 9 $label11.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label11.Size = $System_Drawing_Size $label11.Text = "Service" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 234 $label11.Location = $System_Drawing_Point $label11.DataBindings.DefaultDataSourceUpdateMode = 0 $label11.Name = "label11" $label11.add_Click($handler_label11_Click) $panel1.Controls.Add($label11) $label10.TabIndex = 8 $label10.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label10.Size = $System_Drawing_Size $label10.Text = "IPphone" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 4 $System_Drawing_Point.Y = 207 $label10.Location = $System_Drawing_Point $label10.DataBindings.DefaultDataSourceUpdateMode = 0 $label10.Name = "label10" $label10.add_Click($handler_label10_Click) $panel1.Controls.Add($label10) $label9.TabIndex = 7 $label9.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label9.Size = $System_Drawing_Size $label9.Text = "Mobile" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 180 $label9.Location = $System_Drawing_Point $label9.DataBindings.DefaultDataSourceUpdateMode = 0 $label9.Name = "label9" $panel1.Controls.Add($label9) $label8.TabIndex = 6 $label8.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 16 $label8.Size = $System_Drawing_Size $label8.Text = "Fax" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 157 $label8.Location = $System_Drawing_Point $label8.DataBindings.DefaultDataSourceUpdateMode = 0 $label8.Name = "label8" $label8.add_Click($handler_label8_Click) $panel1.Controls.Add($label8) $label7.TabIndex = 5 $label7.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 16 $label7.Size = $System_Drawing_Size $label7.Text = "Téléphone" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 131 $label7.Location = $System_Drawing_Point $label7.DataBindings.DefaultDataSourceUpdateMode = 0 $label7.Name = "label7" $panel1.Controls.Add($label7) $label6.TabIndex = 4 $label6.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label6.Size = $System_Drawing_Size $label6.Text = "Mail" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 105 $label6.Location = $System_Drawing_Point $label6.DataBindings.DefaultDataSourceUpdateMode = 0 $label6.Name = "label6" $panel1.Controls.Add($label6) $label5.TabIndex = 3 $label5.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 14 $label5.Size = $System_Drawing_Size $label5.Text = "Fonction" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 79 $label5.Location = $System_Drawing_Point $label5.DataBindings.DefaultDataSourceUpdateMode = 0 $label5.Name = "label5" $panel1.Controls.Add($label5) $label4.TabIndex = 2 $label4.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label4.Size = $System_Drawing_Size $label4.Text = "Prénom" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 55 $label4.Location = $System_Drawing_Point $label4.DataBindings.DefaultDataSourceUpdateMode = 0 $label4.Name = "label4" $panel1.Controls.Add($label4) $label3.TabIndex = 1 $label3.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label3.Size = $System_Drawing_Size $label3.Text = "Nom" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 32 $label3.Location = $System_Drawing_Point $label3.DataBindings.DefaultDataSourceUpdateMode = 0 $label3.Name = "label3" $label3.add_Click($handler_label3_Click) $panel1.Controls.Add($label3) $label2.TabIndex = 0 $label2.TextAlign = 2 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 15 $label2.Size = $System_Drawing_Size $label2.Text = "Login" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 7 $System_Drawing_Point.Y = 8 $label2.Location = $System_Drawing_Point $label2.DataBindings.DefaultDataSourceUpdateMode = 0 $label2.Name = "label2" $panel1.Controls.Add($label2) $Button_Modifier_Nom.TabIndex = 5 $Button_Modifier_Nom.Name = "Button_Modifier_Nom" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 75 $System_Drawing_Size.Height = 23 $Button_Modifier_Nom.Size = $System_Drawing_Size $Button_Modifier_Nom.UseVisualStyleBackColor = $True $Button_Modifier_Nom.Visible = $False $Button_Modifier_Nom.Text = "Save" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 248 $System_Drawing_Point.Y = 70 $Button_Modifier_Nom.Location = $System_Drawing_Point $Button_Modifier_Nom.DataBindings.DefaultDataSourceUpdateMode = 0 $Button_Modifier_Nom.add_Click($Button_Modifier_Nom_OnClick) $form1.Controls.Add($Button_Modifier_Nom) $Button_import.TabIndex = 5 $Button_import.Name = "Button_import" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 75 $System_Drawing_Size.Height = 23 $Button_import.Size = $System_Drawing_Size $Button_import.UseVisualStyleBackColor = $True $Button_import.Visible = $True $Button_import.Text = "Import" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 325 $System_Drawing_Point.Y = 70 $Button_import.Location = $System_Drawing_Point $Button_import.DataBindings.DefaultDataSourceUpdateMode = 0 $Button_import.add_Click($Button_import_OnClick) $form1.Controls.Add($Button_import) $progressBar1.DataBindings.DefaultDataSourceUpdateMode = 0 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 409 $System_Drawing_Size.Height = 23 $progressBar1.Size = $System_Drawing_Size $progressBar1.TabIndex = 4 $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 380 $System_Drawing_Point.Y = 3 $progressBar1.Location = $System_Drawing_Point $progressBar1.Name = "progressBar1" $form1.Controls.Add($progressBar1) $label1.TabIndex = 3 $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 23 $label1.Size = $System_Drawing_Size $label1.Text = "Entrer Nom" $label1.AutoSize = $True $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 40 $System_Drawing_Point.Y = 43 $label1.Location = $System_Drawing_Point $label1.DataBindings.DefaultDataSourceUpdateMode = 0 $label1.Name = "label1" $form1.Controls.Add($label1) $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 100 $System_Drawing_Size.Height = 20 $Recherche_Nom.Size = $System_Drawing_Size $Recherche_Nom.DataBindings.DefaultDataSourceUpdateMode = 0 $Recherche_Nom.Name = "Recherche_Nom" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 40 $System_Drawing_Point.Y = 72 $Recherche_Nom.Location = $System_Drawing_Point $Recherche_Nom.TabIndex = 1 $Recherche_Nom.add_TextChanged($handler_textBox1_TextChanged) $form1.Controls.Add($Recherche_Nom) $Button_Recherche_Nom.TabIndex = 0 $Button_Recherche_Nom.Name = "Button_Recherche_Nom" $System_Drawing_Size = New-Object System.Drawing.Size $System_Drawing_Size.Width = 75 $System_Drawing_Size.Height = 23 $Button_Recherche_Nom.Size = $System_Drawing_Size $Button_Recherche_Nom.UseVisualStyleBackColor = $True $Button_Recherche_Nom.Text = "Recherche nom" $System_Drawing_Point = New-Object System.Drawing.Point $System_Drawing_Point.X = 158 $System_Drawing_Point.Y = 70 $Button_Recherche_Nom.Location = $System_Drawing_Point $Button_Recherche_Nom.DataBindings.DefaultDataSourceUpdateMode = 0 $Button_Recherche_Nom.add_Click($handler_Button_Recherche_Nom_Click) $form1.Controls.Add($Button_Recherche_Nom) #endregion Generated Form Code #Save the initial state of the form $InitialFormWindowState = $form1.WindowState #Init the OnLoad event to correct the initial state of the form $form1.add_Load($OnLoadForm_StateCorrection) #Show the Form $form1.ShowDialog()| Out-Null } #End Function #Call the Function GenerateForm