Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $time = (Get-Date -UFormat "%m/%d/%y")
- $opendbbakpath =
- $userlistpath =
- function update-taskusers {
- get-aduser -filter {(enabled -eq $true -and passwordneverexpires -eq $false)} | select -ExpandProperty name | Export-Clixml -Path $userlistpath
- }
- Function Create-XML
- {
- $tasks = @()
- $tasks += new-object psobject -property @{index=1;createdate=($time);description="nulltask";user=$user}
- $tasks += new-object psobject -property @{index=2;createdate=($time);description="nulltask";user=$user}
- $tasks += new-object psobject -property @{index=3;createdate=($time);description="nulltask";user=$user}
- $tasks | Export-Clixml -Path "$opendbpath"
- }
- Function New-Task
- {
- $tasks = @()
- $tasks = Import-Clixml -Path "$opendbpath"
- [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
- $description = [Microsoft.VisualBasic.Interaction]::InputBox('description?')
- $userlist = Import-Clixml -Path $userlistpath
- $user = $userlist | Out-GridView -PassThru
- $index = ($tasks | select -ExpandProperty index -Last 1)+1
- $tasks += new-object psobject -property @{index=$index;createdate=($time);description=$description;user=$user}
- $tasks | Export-Clixml -Path "$opendbpath"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement