Add files via upload #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
Form Tasarımı
$Form = New-Object System.Windows.Forms.Form
$Form.Text = "Active Directory Kullanıcı Bilgisi"
$Form.Size = New-Object System.Drawing.Size(700, 900)
$Form.StartPosition = "CenterScreen"
$Form.BackColor = [System.Drawing.Color]::FromArgb(240, 240, 240)
Kullanıcı Adı Etiketi
$Label = New-Object System.Windows.Forms.Label
$Label.Text = "Kullanıcı Adı:"
$Label.Location = New-Object System.Drawing.Point(20, 20)
$Label.AutoSize = $true
$Form.Controls.Add($Label)
Kullanıcı Adı İçin TextBox
$TextBox = New-Object System.Windows.Forms.TextBox
$TextBox.Location = New-Object System.Drawing.Point(120, 18)
$TextBox.Width = 150
$Form.Controls.Add($TextBox)
Grup Adı Etiketi
$LabelGrup = New-Object System.Windows.Forms.Label
$LabelGrup.Text = "Grup Adı:"
$LabelGrup.Location = New-Object System.Drawing.Point(20, 20)
$LabelGrup.AutoSize = $true
$LabelGrup.Visible = $false
$Form.Controls.Add($LabelGrup)
Grup Adı İçin TextBox
$TextBoxGrup = New-Object System.Windows.Forms.TextBox
$TextBoxGrup.Location = New-Object System.Drawing.Point(120, 18)
$TextBoxGrup.Width = 250
$TextBoxGrup.Visible = $false
$Form.Controls.Add($TextBoxGrup)
Kullanıcı Fotoğrafı
$PictureBox = New-Object System.Windows.Forms.PictureBox
$PictureBox.Location = New-Object System.Drawing.Point(500, 20)
$PictureBox.Size = New-Object System.Drawing.Size(100, 100)
$PictureBox.BorderStyle = "FixedSingle"
$PictureBox.SizeMode = "StretchImage"
$Form.Controls.Add($PictureBox)
Kullanıcılar Butonu
$BtnKullanicilar = New-Object System.Windows.Forms.Button
$BtnKullanicilar.Text = "Kullanıcılar"
$BtnKullanicilar.Size = New-Object System.Drawing.Size(100, 30)
$BtnKullanicilar.Location = New-Object System.Drawing.Point(($PictureBox.Location.X - 100), ($PictureBox.Location.Y + $PictureBox.Height + 10)) # Y koordinatını biraz artır
$Form.Controls.Add($BtnKullanicilar)
Gruplar Butonu
$BtnGruplar = New-Object System.Windows.Forms.Button
$BtnGruplar.Text = "Gruplar"
$BtnGruplar.Size = New-Object System.Drawing.Size(100, 30)
$BtnGruplar.Location = New-Object System.Drawing.Point(($BtnKullanicilar.Location.X + $BtnKullanicilar.Width), $BtnKullanicilar.Location.Y)
$Form.Controls.Add($BtnGruplar)
Kullanıcı Bilgilerini Gösteren ListBox
$ListBox = New-Object System.Windows.Forms.ListBox
$ListBox.Location = New-Object System.Drawing.Point(20, 170)
$ListBox.Size = New-Object System.Drawing.Size(600, 300)
$ListBox.SelectionMode = "MultiExtended"
$ListBox.ContextMenuStrip = New-Object System.Windows.Forms.ContextMenuStrip
$CopyMenuItem = New-Object System.Windows.Forms.ToolStripMenuItem
$CopyMenuItem.Text = "Kopyala"
$CopyMenuItem.Add_Click({
$SelectedItems = $ListBox.SelectedItems | ForEach-Object { $_ }
if ($SelectedItems) {
[System.Windows.Forms.Clipboard]::SetText($SelectedItems -join "
r
n")}
})
$ListBox.ContextMenuStrip.Items.Add($CopyMenuItem)
$Form.Controls.Add($ListBox)
Kullanıcı Grupları ListBox
$GroupsListBox = New-Object System.Windows.Forms.ListBox
$GroupsListBox.Location = New-Object System.Drawing.Point(20, 500)
$GroupsListBox.Size = New-Object System.Drawing.Size(600, 250)
$GroupsListBox.SelectionMode = "MultiExtended"
$GroupsListBox.ContextMenuStrip = New-Object System.Windows.Forms.ContextMenuStrip
$CopyMenuItem1 = New-Object System.Windows.Forms.ToolStripMenuItem
$CopyMenuItem1.Text = "Kopyala"
$CopyMenuItem1.Add_Click({
$SelectedItems = $GroupsListBox.SelectedItems | ForEach-Object { $_ }
if ($SelectedItems) {
[System.Windows.Forms.Clipboard]::SetText($SelectedItems -join "
r
n")}
})
$GroupsListBox.ContextMenuStrip.Items.Add($CopyMenuItem1)
$Form.Controls.Add($GroupsListBox)
GrupMemberlarını Gösteren ListBox
$GrupMember = New-Object System.Windows.Forms.ListBox
$GrupMember.Location = New-Object System.Drawing.Point(20, 330)
$GrupMember.Size = New-Object System.Drawing.Size(600, 400)
$GrupMember.SelectionMode = "MultiExtended"
$GrupMember.ContextMenuStrip = New-Object System.Windows.Forms.ContextMenuStrip
$GrupMember.Visible = $false
$CopyMenuItem = New-Object System.Windows.Forms.ToolStripMenuItem
$CopyMenuItem.Text = "Kopyala"
$CopyMenuItem.Add_Click({
$SelectedItems = $GrupMember.SelectedItems | ForEach-Object { $_ }
if ($SelectedItems) {
[System.Windows.Forms.Clipboard]::SetText($SelectedItems -join "
r
n")}
})
$GrupMember.ContextMenuStrip.Items.Add($CopyMenuItem)
$Form.Controls.Add($GrupMember)
Grup özellikleri
$GroupPropertyListBox = New-Object System.Windows.Forms.ListBox
$GroupPropertyListBox.Location = New-Object System.Drawing.Point(20, 170)
$GroupPropertyListBox.Size = New-Object System.Drawing.Size(600, 150)
$GroupPropertyListBox.SelectionMode = "MultiExtended"
$GroupPropertyListBox.Visible = $false
$GroupPropertyListBox.ContextMenuStrip = New-Object System.Windows.Forms.ContextMenuStrip
$CopyMenuItem1 = New-Object System.Windows.Forms.ToolStripMenuItem
$CopyMenuItem1.Text = "Kopyala"
$CopyMenuItem1.Add_Click({
$SelectedItems = $GroupPropertyListBox.SelectedItems | ForEach-Object { $_ }
if ($SelectedItems) {
[System.Windows.Forms.Clipboard]::SetText($SelectedItems -join "
r
n")}
})
$GroupPropertyListBox.ContextMenuStrip.Items.Add($CopyMenuItem1)
$Form.Controls.Add($GroupPropertyListBox)
Bilgileri Getir Butonu
$Button = New-Object System.Windows.Forms.Button
$Button.Text = "Sorgula"
$Button.Location = New-Object System.Drawing.Point(20, 100)
$Button.BackColor =[System.Drawing.Color]::Red
$Button.ForeColor = [System.Drawing.Color]::White
$Button.Size = New-Object System.Drawing.Size(100, 30)
$Button.Controls.Add($GroupsButton)
Gruplar Butonu (Sorgula butonunun hemen altında)
$GroupsButton = New-Object System.Windows.Forms.Button
$GroupsButton.Text = "Gruplar"
$GroupsButton.Location = New-Object System.Drawing.Point(20, 100)
$GroupsButton.BackColor =[System.Drawing.Color]::Red
$GroupsButton.ForeColor = [System.Drawing.Color]::White
$GroupsButton.Size = New-Object System.Drawing.Size(100, 30)
$GroupsButton.Visible = $false
$Form.Controls.Add($GroupsButton)
$BtnGruplar.Add_Click({
$GroupsListBox.Visible = $false
$ListBox.Visible = $false
$GroupsButton.Visible = $true
$LabelGrup.Visible = $true
$TextBoxGrup.Visible = $true
$Label.Visible = $false
$TextBox.Visible = $false
$Button.Visible = $false
$GroupsButton.Visible = $true
$PictureBox.Visible = $false
$GrupMember.Visible = $true
$GroupPropertyListBox.Visible = $true
})
$BtnKullanicilar.Add_Click({
$GroupsListBox.Visible = $true
$ListBox.Visible = $true
$GroupsButton.Visible = $false
$LabelGrup.Visible = $false
$TextBoxGrup.Visible = $false
$Label.Visible = $true
$TextBox.Visible = $true
$Button.Visible = $true
$GroupsButton.Visible = $false
$PictureBox.Visible = $true
$GrupMember.Visible = $false
$GroupPropertyListBox.Visible = $false
})
$Button.Add_Click({
$GroupsListBox.Visible = $true # Grupları tekrar görünür yap
$ListBox.Visible = $true # Kullanıcı bilgilerini tekrar görünür yap
$Username = $TextBox.Text
if ($Username -ne "") {
Try {
# Active Directory'den Kullanıcı Bilgilerini Çek
$User = Get-ADUser -Identity $Username -Properties *
})
$Form.Controls.Add($Button)
$GroupsButton.Add_Click({
})
Sürüm ve Web Sitesi Bilgisi - Formun en alt soluna yerleştirme
$VersionLabel = New-Object System.Windows.Forms.Label
$VersionLabel.Text = "Zinnet Arıcı | Sürüm 1.6 | Güncellenme: 2025-05-16"
$VersionLabel.Location = New-Object System.Drawing.Point(20, ($Form.ClientSize.Height - 30)) # Formun en altına konumlandır
$VersionLabel.AutoSize = $true
$VersionLabel.ForeColor = [System.Drawing.Color]::Gray
$Form.Controls.Add($VersionLabel)
Formu Göster
$Form.ShowDialog()