PowerShell - Bulk Clear-ADAccountExpiration

Error Message: Cannot Validate argument on parameter 'Identify'. The argument is null. Csv filesamAccountNameTst_Posh1Tst_Posh2Import-Module ActiveDirectory
$count = 0
$UserId = Import-Csv c:\temp\Clear-Acct-Exp-Date.csv
$out = "Findings `r`n" #File Heading
ForEach($Item in $UserId)
$count++
Clear-ADAccountExpiration -Identity $Item.samAccountName
Write-Host $Item.samAccountName ":" $count
$Out += $Item.samAccountName + ":" + $count + " `r`n"
$out | Out-File c:\temp\Clear-Acct-Exp-Date.txt
mamadukes

Hi,
According to the error, you're using -Identify somewhere instead of -Identity.
http://technet.microsoft.com/en-us/library/ee617213.aspx
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing)

Similar Messages

  • Excel & Powershell: Bulk Find and replace URL's used in forumlas

    Hi, I'm working on creating a script that I will provide a list of SharePoint 2007 document libraries to which will do the following:
    In Excel, find formulas within cells that link to other workbooks + sheets (XLS/XLSX)
    If found, replace the formula link http://serverold/site/doclib/ with
    http://servernew/sites/sitecollection/doclib and save
    Else, close the workbook and move onto the next
    Log full URL and filename of any changes
    Using the code on this
    link  as my starting point I cannot get the following working:
    1. The regex expression to make the script detect the URL in the formulas
    2. modify the script to replace the old path with the new path in the formula within cells.
    3. a for each branch to deal with when the match is found (save and close) and when it's not found (just close)
    I'm not going into detail on all the research I've done (info is very light on the ground), just that it is mentioned on another thread that you can enumerate these
    links centrally in Excel but no example or links were given and when I've tried to enumerate the links collection in PowerShell (with Excel 2010 installed) it is empty with the example workbook I'm using which I know as "links" in that sense. 
    Example to enumerate link collections:
    $File = "C:\temp\example.xls"
    $Excel = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook = $Excel.workbooks.open($file)
    $Workbook.LinkSources
    So it begs the question, which method is right?
    Example Excel formula
    =+'http://serverold/site/site/Work in Progress Documents/Statements/[Hierarchy2011.xls]Reports'!$AD$37+'http://serverold/site/site/Work in Progress Documents/
    Script to enumerate links (from the link I mentioned as my starting point) - 
    $path = "C:\temp"
    $excelSheets = Get-Childitem -Path $path -Include *.xls,*.xlsx -Recurse
    $excel = New-Object -comobject Excel.Application
    $excel.visible = $false
    foreach($excelSheet in $excelSheets)
    $workbook = $excel.Workbooks.Open($excelSheet)
    "There are $($workbook.Sheets.count) sheets in $excelSheet"
    For($i = 1 ; $i -le $workbook.Sheets.count ; $i++)
    $worksheet = $workbook.sheets.item($i)
    "`tLooking for links on $($worksheet.name) worksheet"
    $rowMax = ($worksheet.usedRange.rows).count
    $columnMax = ($worksheet.usedRange.columns).count
    For($row = 1 ; $row -le $rowMax ; $row ++)
    For($column = 1 ; $column -le $columnMax ; $column ++)
    [string]$formula = $workSheet.cells.item($row,$column).formula
    if($formula -match "\w?:\\\w*\\\[\w*\.xls\w?\]") {"`t`t$($formula)"}
    } #end for $column
    } #end for $row
    $worksheet = $rowmax = $columnMax = $row = $column = $formula = $null
    } #end for
    $workbook.saved = $true
    $workbook.close()
    } #end foreach
    $excel.quit()
    $excel = $null
    [gc]::collect()
    [gc]::WaitForPendingFinalizers()
    Thanks to anyone who can help and for your time.
    Bests,
    Ash

    Hi,
    Just checking in to see if the suggestion was helpful. Please let us know if you would like further assistance.
    TechNet Subscriber Support
    If you are
    TechNet Subscription
    user and have any feedback on our support quality, please send your feedback
    here.
    Cataleya Li
    TechNet Community Support

  • Powershell - Bulk Set-ADUser attributes via a CSV file

    I am attempting to do a Bulk replace of AD User account attributes via a CSV file.  Each line in this script works except the part of Set-ADUser where I enter -Replace $attribs. I'm not sure how to code this
    part.
    <#
    The .csv file should have the following headers (first line)
    GroupName,Status,Approver1,Approver2,Owner
    #>
    #Import CSV
    $csv = @()
    $csv = Import-Csv -Path "C:\TempAdd_Grp_Attrib.csv"
    #Loop through all items in the CSV
    ForEach ($item In $csv)
    $gname = $item.GroupName
    $attribs = @{'extensionAttribute2'=$item.Status; 'extensionAttribute3'=$item.Approver1; 'extensionAttribute4'=$item.Approver2; 'managedBy'=$item.Owner}
    Set-ADGroup -Identity $gname #-Replace $attribs
    mamadukes

    Yes. I am attempting to update the AD Group extension attributes.
    The code below works, but I know I can streamline this if I use the INSTANCE, which I am having an issue with (Set-ADGroup -Instance $Update)
    Import-Module ActiveDirectory
    <#
    The .csv file should have the following headers (first line)
    GroupName,Status,Approver1,Approver2,Owner
    #>
    #Import CSV
    $date = get-date -Format "MMddyyyymm"
    $csv = @()
    $csv = Import-Csv -Path "C:\Temp\Add_Grp_Attrib2.csv"
    #Loop through all items in the CSV
    ForEach ($item In $csv)
    $Update=(Get-ADGroup $item.GroupName -Properties extensionAttribute2,extensionAttribute3,extensionAttribute4,ManagedBy);
    $Update."extensionAttribute2"=$item.Status
    $Update."extensionAttribute3"=$item.Approver1
    $Update."extensionAttribute4"=$item.Approver2
    # Set-ADGroup -instance $Update
    Set-ADGroup -Identity $item.groupName -ManagedBy $item.Owner
    Get-ADGroup $item.GroupName -Properties extensionAttribute2,extensionAttribute3,extensionAttribute4,ManagedBy | select name,extensionAttribute2,extensionAttribute3,extensionAttribute4,ManagedBy | Export-Csv "C:\temp\Add_Grp_Attrib_Updates_$date.csv" -NoTypeInformation
    mamadukes

  • PowerShell - Bulk-New-ADUser Creation via a csv file

    This script creates bulk AD users via a csv file. The script creates & configures the user accounts correctly even though the following error message appears. How can I correct this?
    Set-Locaiton : Cannot find path 'AD:Mydomain,OU=MyDomain,DC=My,DC=Domain,DC=org' because it does not exist.
    Import-Module ActiveDirectory
    $csv = Import-CSV -Path "C:\Temp\CreateUsers.csv"
    cd AD:
    set-location -path "OU=MyDomain,DC=My,DC=Domain,DC=org" -PassThru
    foreach($Item in $csv){
    $newUserID=@{
    Name=$item.userID
    Description=$item.description
    GivenName=$item.UserID
    surName=$item.UserID
    DisplayName=$item.UserID
    UserPrincipalName=$item.UserID + "@MyDomain.org"
    EmployeeID=$item.Owner
    ScriptPath="login.cmd"
    Try{
    New-ADUser @newUserID -ErrorAction Stop -AccountPassword (ConvertTo-SecureString $Item.Password -AsPlainText -Force) -PassThru
    Enable-ADAccount -Identity $item.userID
    Set-ADUser -Identity $item.userID -ChangePasswordAtLogon $true
    Write-Host "UserID $($item.UserID) created!" -ForegroundColor green
    Catch{
    Write-Host "There was a problem creating UserID $($item.UserID). The account was not created!" -ForegroundColor Red
    set-location -path "c:\temp"
    mamadukes

    Slight variation, populated from the AdventureWorks SQL database rather than a CSV
    Import-Module "SQLPS" -DisableNameChecking
    New-PSDrive -Name AWDB -PSProvider SQLServer -ROOT SQLSERVER:\sql\localhost\default\databases\adventureworks2012
    Set-Location AWDB:\Tables
    $SQLText = "SELECT e.BusinessEntityID, p.Title, p.FirstName, p.MiddleName, p.LastName, p.Suffix, "+
    "e.JobTitle, d.Name AS Department, d.GroupName, edh.StartDate, e.LoginID"+
    " FROM HumanResources.Employee AS e"+
    " INNER JOIN Person.Person AS p ON p.BusinessEntityID = e.BusinessEntityID"+
    " INNER JOIN HumanResources.EmployeeDepartmentHistory AS edh ON e.BusinessEntityID = edh.BusinessEntityID"+
    " INNER JOIN HumanResources.Department AS d ON edh.DepartmentID = d.DepartmentID"+
    " WHERE (edh.EndDate IS NULL)"+
    " AND (p.FirstName ='Brian')"
    $Query = Invoke-SQLCmd -Query $SQLText
    $Password = "P@assword1"
    foreach($Item in $Query)
    $LoginID=$Item.LoginID
    $LoginID="CORP\"+($LoginID).Substring(16)
    $newUserID=@{
    Name=$item.FirstName+$Item.LastName
    Description="This is a test of a bulk user add"
    GivenName=$item.FirstName
    Surname=$item.LastName
    DisplayName=$item.FirstName+" "+$Item.LastName
    UserPrincipalName="$($item.FirstName+"."+$Item.LastName)@corp.contoso.com"
    EmployeeID=$item.BusinessEntityID
    ScriptPath='login.cmd'
    Company="Contoso"
    Department=$Item.Department
    EmailAddress="$($item.FirstName+"."+$Item.LastName)@corp.contoso.com"
    Title=$Item.JobTitle
    $TargetOU="OU="+$item.Department+",DC=corp,DC=contoso,DC=com"
    Try{
    $newUserID
    New-ADUser @newUserID -Path $TargetOU -ErrorAction Stop -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Passthru
    Enable-ADAccount -Identity $newUserID.Name
    Set-ADUser -Identity $newUserID.Name -ChangePasswordAtLogon $true
    Write-Host "UserID $($newUserID.Name) created!" -ForegroundColor green
    Catch{
    Write-Host "There was a problem creating UserID $($item.UserID). The account was not created!" -ForegroundColor Red
    No need to be on the PSDrive AD:, the OU can be specified in the Path parameter in the New-ADUser.
    This was done on a member server with SQL Server (not a domain controller).
    Thanks for your help

  • Is it possible to BULK clear an attribute value in FIM

    Hello Everybody,
         Due to a new company policy I must clear the jobtitle value in FIM for all users. I used ADModify.net to set Null for the attribute and this works in Active directory for all users. So I set the AD management agent to have the highest
     precedence and performed a full import, followed by a full sync, and finally and export on the FIM management agent however it did not clear the value for all the fim objects. I have tested changing one of the objects value to "test" and doing
    the same and it does change in FIM so I'm at a loss why it wont take the Null.
          I'm under a strict deadline and seem to be stuck so any advice would be greatly appreciated. 

    Hello,
    I've descibed something similar in my blog post, ist about clearing up membership from groups, but you can adapt this to your needs for person objects.
    http://justidm.wordpress.com/2013/10/14/correct-group-objects-with-waring-dynamic-group-has-static-member/
    Just use the Replace operation instead of Delete and Define the ArrtibuteName (jobtitle in your case) but do not set the AttributeValue (don't set it to empty string instead just omit the property)
    Regards
    Peter
    Peter Stapf - Doeres AG - My blog:
    JustIDM.wordpress.com
    Hi Peter,
        I tried to modify your script and am having some issues. If you can please take a look at this and let me know what I'm doing wrong.
    When I try to run the script I receive an error as stated below
    PS C:\Windows\system32> $personlist = Export-FIMConfig -OnlyBaseResources -custom "/Person"
    Export-FIMConfig : Failure on making enumeration web service call.
    Filter = /Person
    Error= The web service client has encountered the following class of error: IdentityIsNotFound
    Details: Additional Text Details: The requestor's identity was not found.
    Correlation Identifier: 99e5de66-b204-4b53-954d-6009c223fe42
    Failure Message:
    Request Identifier:
    At line:1 char:31
    + $personlist = Export-FIMConfig <<<< -OnlyBaseResources -custom "/Person"
    + CategoryInfo : InvalidOperation: (:) [Export-FIMConfig], InvalidOperationException
    + FullyQualifiedErrorId : ExportConfig,Microsoft.ResourceManagement.Automation.ExportConfig
    add-pssnapin FIMAutomation
    $personlist = Export-FIMConfig -only -custom "/Person"
    If ($personlist -eq $null) { Write-Host "There are no people" ; exit }
    foreach ($person in $personlist)
    $memberlist=($person.ResourceManagementObject.ResourceManagementAttributes).Values
    $importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
    $importObject.ObjectType = "Person"
    $importObject.TargetObjectIdentifier = $person.ResourceManagementObject.ObjectIdentifier
    $importObject.SourceObjectIdentifier = $person.ResourceManagementObject.ObjectIdentifier
    $importObject.State = 1
    foreach ($member in $memberlist)
    $importChange = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange
    $importChange.Operation = [Microsoft.ResourceManagement.Automation.ObjectModel.ImportOperation]::Replace
    $importChange.AttributeName = "JobTitle"
    $importChange.AttributeValue = $member.Replace()
    $importChange.FullyResolved = 1
    $importChange.Locale = "Invariant"
    $importObject.Changes += $importChange
    $importObject | Import-FIMConfig

  • Exchange mailboxes, corporate AD, forest trust, arrays, Can you look this over?

    This is my first script, it took a while to figure some things out, but it is working. I wanted to know if it is overkill, or if there is something that sticks out that would be an easier way of accomplishing something with this script.
    Background info:
    Company was bought out, forest trust set up between corp network and ours (years ago). So what we wanted was to compare exchange mailboxes with linked mailboxes array, to be compared to corporate AD array with user accounts that are disabled. a list is created
    in another script which shows linked mailboxes and disabled corp AD accounts, helpdesk looks these through to make sure there are no exceptions. Exceptions are entered into PS cmdline, those are pulled out of the array. Then the left objects in the array are
    PST backed up to network share, and then mailboxes removed. Admin trust across corp allows Exchange admin to search through Corp AD through search-AdAccount cmdlet. The script is run from a VM with exchange server tools installed and running 32-bit os of Windows
    7 and 32-bit Office (Because that's how great... Exchange 2007 is for exporting mailboxes to PST). 
    Not sure of this, though it works: 
    <#Clear variables so they are not retaining any old values#>
    Get-Variable -Exclude PWD,*Preference | Remove-Variable -EA 0
    Wanted to clear variables before running script, data was being held over each run before adding this in
    Here is the code "xxxxx" used in lieu of server names:
    <#Import in modules, if statement for PSSnapin so that it doesn't throw an error if it is already loaded.#>
    Import-Module ActiveDirectory
    if ( (Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue) -eq $null )
        add-pssnapin Microsoft.Exchange.Management.PowerShell.Admin
    <#Clear variables so they are not retaining any old values#>
    Get-Variable -Exclude PWD,*Preference | Remove-Variable -EA 0
    <#Variables needed to complete script. $testIteration shows the number of times nested for loop happens, $exUserCorpMatch=@() is an empty array that will have objects added to it
    when linked mailboxes on Exchange are compared to disabled corp accounts, the $adminUser and $adPW are the login credentials so that anyone can enter admin login credentials to run script#>
    $errorLogPath = "c:\scripts\logs\exchangeADerror.txt"
    $testIteration=0
    $exUserCorpMatch=@()
    $adminUser = whoami
    $exceptionUsers=@()
    $exceptionArray=@()
    <#Create an Array from Get-mailbox cmdlet that has the value "LinkedMailbox" tying it to a Corporate account, .count value used to check results against expected#>
    $mailboxes = Get-Mailbox -resultSize unlimited -RecipientTypeDetails LinkedMailbox
    $mailboxes.count
    <#Create an array of objects from Corp server of user only dissabled accounts, .count value used to check results against expected#>
    $corpAccDis = Search-ADAccount -ResultSetSize $null -Server xxxxx -AccountDisabled -UsersOnly
    $corpAccDis.count
    <#Read in a list of users whose mailboxes shouldn't be removed#>
    while ($var -ne "q"){
        $var = Read-Host "Enter user exception linked mailbox name, or press q to quit entering names:"
        if ($var -ne "q"){
        $exceptionUsers += $var
    $exceptionUsers.count
    <#Create an Array with the usernames that were supplied by the Read-Host Cmdlet#>
    foreach ($name in $exceptionUsers){ 
    $exceptionArray += Get-Mailbox -Identity $name
    $exceptionArray
    <#Compare the two arrays on the value of name from the "Linked Master Account" and the Corp server "Sam Account Name" and insert the matching objects into an Array#>
    For ($a=0 ; $a -le $mailboxes.count -1 ; $a++){ 
        For ($b=0 ; $b -le $corpAccDis.count -1 ; $b++){
        $testIteration++
                            if ($mailboxes[$a].LinkedMasterAccount.Split("\")[-1] -eq $corpAccDis[$b].SamAccountName){
                                $exUserCorpMatch += $mailboxes[$a]
                                break
    $testIteration  #Test value checking nember of times the loop took place
    $exUserCorpMatch.count
    <#For loop to take exception users mailboxes out of the script#>
    For ($d=0;$d -lt $exceptionArray.Count; $d++){
        $exUserCorpMatch = $exUserCorpMatch| ? {$_.alias -ne $exceptionArray[$d].alias}
    $exUserCorpMatch.count
    $exUserCorpMatch | sort
    <#Taking the newly created array from the comparison and running the bulk of decisions, gives full access rights to the before entered admin account, then exports the mailbox to a PST
    file on the network share, and produces a txt file of the users properties, attributes, etc.. Then removes-mailbox, this is cmdlet is currently commented out until testing is done and 
    confirmed removal is ready to take place. #>
    for ($c = 0 ; $c -le $exUserCorpMatch.count -1; $c++){
        $fileCreationTime = Get-Date -UFormat "%Y%m%d%H%M%S"
        $displayName = $exUserCorpMatch[$c].DisplayName
        $pstFolderPath = Join-Path "\\xxxxx\exchangePST\" $fileCreationTime$displayName.PST
        $txtFolderPath = Join-Path "\\xxxxx\exchangePST\" $fileCreationTime$displayName.txt
        try {
            $everythingIsOk = $true
            Add-MailboxPermission -Identity $exUserCorpMatch[$c] -User $adminUser -AccessRights FullAccess -ErrorAction Stop -Verbose
        } catch {
            $everythingIsOk = $false
            Write-Warning "Permission add problem, logging error to $errorLogPath!"
            Write-Warning $error[0]
            $error[0] | Out-File $errorLogPath -Append
        if ($everythingIsOk){
            try{
            Export-Mailbox -Identity $exUserCorpMatch[$c] -PSTFolderPath $pstFolderPath -ErrorAction Stop -Verbose
            }catch{
            $everythingIsOk = $false
            Write-Warning "Export problem!"
            Write-Warning $error[0]
            $error[0] | Out-File $errorLogPath -Append
        if ($everythingIsOk){
            try {
            Get-Mailbox -Identity $exUserCorpMatch[$c] | FL | Out-File $txtFolderPath -ErrorAction Stop -Verbose
            } catch {
            $everythingIsOk = $false
            Write-Warning "Problem writing to txt"
            Write-Warning $error[0]
            $error[0] | Out-File $errorLogPath -Append
        if ($everythingIsOk){
            try{
            Write-Verbose "!!!!!!!!!!!!!!!!!!"
            <#Remove-Mailbox -Identity $exUserCorpMatch[$c] -Permanent $true -ErrorAction Stop -Verbose#>
            } catch {
             Write-Warning $error[0]
             $error[0] | Out-File $errorLogPath -Append

    Half of you code appears to be doing nothing.
    This does nothing:
    if ($everythingIsOk){
            try{
            Write-Verbose "!!!!!!!!!!!!!!!!!!"
            <#Remove-Mailbox -Identity $exUserCorpMatch[$c] -Permanent $true -ErrorAction Stop -Verbose#>
            } catch {
             Write-Warning $error[0]
             $error[0] | Out-File $errorLogPath -Append
    The way we do a limiting Try/Catch is to just use a single "try/catch".
    $fileCreationTime = Get-Date -UFormat "%Y%m%d%H%M%S"
    for ($c = 0 ; $c -lt $exUserCorpMatch.count; $c++){
    $displayName = $exUserCorpMatch[$c].DisplayName
    $pstFolderPath = Join-Path "\\xxxxx\exchangePST\" $fileCreationTime$displayName.PST
    $txtFolderPath = Join-Path "\\xxxxx\exchangePST\" $fileCreationTime$displayName.txt
    try {
    Add-MailboxPermission -Identity $exUserCorpMatch[$c] -User $adminUser -AccessRights FullAccess -ErrorAction Stop -Verbose
    Get-Mailbox -Identity $exUserCorpMatch[$c] | FL | Out-File $txtFolderPath -ErrorAction Stop -Verbose
    <#Remove-Mailbox -Identity $exUserCorpMatch[$c] -Permanent $true -ErrorAction Stop -Verbose#>
    }catch
    Write-Warning $error[0]
    $error[0] | Out-File $errorLogPath -Append
    The following does the same thing your code did.  It executes but aborts further execution on an exception.
    ¯\_(ツ)_/¯

  • How to Export/Import/Create a VM with an existing OS-Drive.

    How do I do the same things that these Power Shell command do with the REST-Based API?
    Export-AzureVM
    Remove-AzureVM
    Import-AzureVM
    New-AzureVM
    Eventually I want to be able to export and import Virtual machines in a similar way to this:
    Export and Remove machine
    Export-AzureVM -ServiceName <ServiceName>  -Name <Name> -Path <FileName>
    Remove-AzureVM -ServiceName <ServiceName>  -Name <Name>
    Import Machine
    Import-AzureVM -Path <FileName> | New-AzureVM -ServiceName <ServiceName> -Location <Location>

    No, still not enough information.
    What I need is a direct mapping between PowerShell commands and rest API calls.
    Something like this:
    Export-AzureVM -ServiceName <ServiceName>  -Name <Name> -Path <FileName>
    MAPS TO
    Rest API and the XML to go with it(with the parameters from the powershell command clearly marked in the xml)
    I thought the intention of the BETA/Preview was to have users/developers test the stuff. But if you want users to do it without any help/documentation
    you can't really be serious about it. And to use a tool like reflector (which
    I now days have to buy) to try to reverse engineer Microsoft code
    to try to figure out how it is done is just so wrong in so many ways.
    If you guys at Microsoft don't get your shit together very soon, than developers will start using documented platforms where stuff actually works.

  • Resource Pool "Observer" - how failover works in SCOM 2012

    We currently have 5 Management Servers SCOM 2012 SP1 Cu6 + a SQL Failover Cluster for SQL database of SCOM/SCOMDW.
    2 of these Management Servers are dedicated for network monitoring of approximately 200-400 network devices (including certified and generic devices). Additionally, we have about 20 distributed apps + 30-40 websphere JVM instances defined which are spread
    accross all management servers.
    my questions
    1.) how can I determine, where a distributed app or network device or websphere instance is currently attached to? They belong to any member in the resource pool, but I haven't found any possbility to query scom (e.g. PowerShell) where a specific entity is
    currently attached.
    2.) for network monitoring, a seperate resource pool is defined (no scom agent is connected to these 2 servers). These two servers have local SSD disks, 2x quad core CPUs and 24GB memory each. When one of these management servers is rebooted, the mistery
    starts. Many distributed apps throw a critical error (unavailable), in the eventlog many network devices throw also an error that they are offline, in SCOM they turn gray. The remaining management server is nearly exploding (high IOPS without much throughput)
    for approx. 30 minutes, it seems that after return of the second management server they try to balance somehow the instances, but with many errors. (antivirus is turned off)
    => now, after several days, we've found somewhere in the internet the info that with 2 management servers in a resource pool, an observer should be defined. Should this resolve our issue or will e.g. the distributed apps always through an alert until their
    state is recalculated? The documentation to the observer function is rare, and we are not able to find any further hint how to resolve our issue when doing reboots of management servers.
    Thanks so far!
    Best Regards Klaus

    Dear Alexis,
    Thanks for your answer. We've now changed the "All Management Server" Resource Pool to "Manual Membership" (through PowerShell), and clearly defined Observers for each resource Pool. Now, if any management server fails, the objects (distributed App, WebSphere
    Instance, ...) turn into "not monitored" instead of "offline" which makes the difference now.
    However, the network monitoring servers need about 30 to 60 minutes after reboot of one of them until they've reprocessed and recalculated everything. Within this time, the disk has 100% active time with approx. 1500 disk transfers/sec and about 1MB/s throughput.
    (we've about 300 network devices - 150 are certified ones - attached to the management servers)
    Best Regards Klaus

  • Firefox beta on my tab does not have the options button, how do I delete unwanted password

    I have a Samsung tab 7 2 I have loaded firefox beta. but am unable to remove an unwanted password that keeps coming up when signing in to my emails.

    If your Samsung tablet has a menu button to the right of the main home button, tap that to open Firefox's menu.
    I know you can "bulk" clear saved passwords using
    menu > Settings > Privacy > Clear Private Data
    but I don't know whether you can remove just one saved password. I saw an add-on named Mobile Password Manager that runs on Firefox for Android. I haven't tried it myself.
    https://addons.mozilla.org/en-US/android/addon/mobile-password-manager/

  • Event 9217 source MSEXchange Tansport

     I have exchange 2010 and I got error with event number 9217 source MS Exchange Transport 
    More than one Active Directory object is configured with the recipient address
    IMCEAEX-ADCDisabledMail@mydomain. Messages to this recipient will be deferred until the configuration is corrected in Active Directory
    how can fix the problem ?

    Hi,
    From your description, the issue is related to the legacyExchangeDN, I recommend you use the following cmdlet in Windows PowerShell to clear it and check the result.
    Get-ADObject -LDAPFilter "(&(objectClass=user)(objectCategory=person)(legacyExchangeDN=ADCDisabledMail))" -Properties LegacyExchangeDN | Set-ADObject -Clear LegacyExchangeDN
    Hope this can be helpful to you.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Amy Wang
    TechNet Community Support

  • Script to cleanup the C drive

    Hi,
    I have SCOM 2007 R2 installed in our environment.  I need to cleanup the C drive space through powershell script. I have already prepared a powershell script. When we manually run the script through powershell, it clears the space from temp directory
    and other locations, which is futile. Now, my question is:
    Can I schedule the script through SCOM so that every time the alert for C drive appears, the script could run automatically and clear the space in C drive?
    Regards

    Hi Gautam,
    I am using PS1 file. I copied the PS1 file at the same location on couple of servers and executed the script through command line rule- scom 2007 r2.
    I have one query. I have developed a powershell script to check the high memory consumption processes and created a diagnostic task for the alert "Available Megabytes of Memory is too low". Therein, during the creation of a diagnostic
    task, the target was by default set to Windows Server 2008 R2 Operating System. I tried to create the task by providing the below details:
    Post providing the parameters, I tried to create it, but it was throwing some error about the target, so I changed the target to Windows 2008 r2 core operating system. After the creation, the script is not yielding any results. However, when I created the
    command line rule with some interval, it was running fine, but that will not suffice the requirement. 
    Any suggestions on that.
    Kind Regards.

  • Bulk create Active Directory Users and Groups in PowerShell using Excel XLSX source file instead of CSV

    Hi Scripting Guy.  I am a Server Administrator who is very familiar with Active Directory, but new to PowerShell.  Like many SysAdmins, I often need to create multiple accounts (ranging from 3-200) and add them multiple groups (ranging
    from 1 - 100).  Previously I used VBS scripts in conjunction with an Excel .XLS file (not CSV file).  Since VBS is essentially out the door and PowerShell is in - I am having to re-create everthing.
    I have written a PowerShell script that bulk creates my users and adds them to their corresponding groups - however, this can only use a CSV file (NOT an XLS file).  I understand that "CSV is much easier to use than Excel worksheets", but
    most times I have three sets of nearly identical groups (for Dev, QA and Prod).  Performing Search and Replace on the Excel template across all four Worksheets ensures the names used are consistent throughout the three environments.
    I know each Excel Worksheet can be exported as a separate CSV file and then use the PowerShell scripts as is, but since I am not the only SysAdmin who will be using these it leads to "unnecessary time lost", not to mention the reality that even
    though you clearly state "These tabs need to be exported using this naming standard" (to work with the PowerShell scripts) that is not the result.
    I've been tasked to find a way to modify my existing PowerShell/CSV scripts to work with Excel spreadsheets/workbooks instead - with no success.  I have run across many articles/forums/scirpts that let you update Excel or export AD data into an Excel
    spreadsheet (even specifying the worksheet, column and row) - but nothing for what I am trying to do.
    I can't imagine that I am the ONLY person who is in this situation/has this need.  So, I am hoping you can help.  How do I modify my existing scripts to reference "use this Excel spreadsheet, and this specific worksheet in the spreadsheet
    prior to performing the New-ADUser/Add-ADGroupMember commands".
    For reference, I am including Worksheet/Column names of my Excel Spreadsheet Template as well as the first part of my PowerShell script.  M-A-N-Y T-H-A-N-K-S in advance.
       Worksheet:  Accounts
         Columns: samAccountName, CN_DisplayName_Name, sn_LastName, givenName_FirstName, Password, Description, TargetOU
       Worksheets:  DevGroups / QAGroups / ProdGroups
         Columns:  GroupName, Members, MemberOf, Description, TargetOU
    # Load PowerShell Active Directory module
    Write-Host "Loading Active Directory PowerShell module." -foregroundcolor DarkCyan # -backgroundcolor Black
    Import-Module ActiveDirectory
    Write-Host " "
    # Set parameter for location of CSV file (so source file only needs to be listed once).
    $path = ".\CreateNewUsers-CSV.csv"
    # Import CSV file as data source for remaining script.
    $csv = Import-Csv -path $path | ForEach-Object {
    # Add '@saccounty.net' suffix to samAccountName for UserPrincipalName
    $userPrincinpal = $_."samAccountName" + "@saccounty.net"
    # Create and configure new AD User Account based on information from the CSV source file.
    Write-Host " "
    Write-Host " "
    Write-Host "Creating and configuring new user account from the CSV source file." -foregroundcolor Cyan # -backgroundcolor Black
    New-ADUser -Name $_."cn_DisplayName_Name" `
    -Path $_."TargetOU" `
    -DisplayName $_."cn_DisplayName_Name" `
    -GivenName $_."givenName_FirstName" `
    -SurName $_."sn_LastName" `
    -SamAccountName $_."samAccountName" `
    -UserPrincipalName $userPrincinpal `

    Here is the same script as a function:
    Function Get-ExcelSheet{
    Param(
    $fileName = 'C:\scripts\test.xls',
    $sheetName = 'csv2'
    $conn = New-Object System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = $fileName;Extended Properties=Excel 8.0")
    $cmd=$conn.CreateCommand()
    $cmd.CommandText="Select * from [$sheetName$]"
    $conn.open()
    $cmd.ExecuteReader()
    It is called like this:
    Get-ExcelSheet -filename c:\temp\myfilename.xslx -sheetName mysheet
    Do NOT change anything in the function and post the exact error.  If you don't have Office installed correctly or are running 64 bits with a 32 bit session you will have to adjust your system.
    ¯\_(ツ)_/¯
    HI JRV,
    My apologies for not responding sooner - I was pulled off onto another project this week.  I have included and called your Get-ExcelSheet function as best as I could...
    # Load PowerShell Active Directory module
    Write-Host "Loading Active Directory PowerShell module." -foregroundcolor DarkCyan # -backgroundcolor Black
    Import-Module ActiveDirectory
    Write-Host " "
    # JRV This Function Loads the Excel Reader
    Function Get-ExcelSheet{
    Param(
    $fileName = 'C:\scripts\test.xls',
    $sheetName = 'csv2'
    $conn = New-Object System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = $fileName;Extended Properties=Excel 8.0")
    $cmd=$conn.CreateCommand()
    $cmd.CommandText="Select * from [$sheetName$]"
    $conn.open()
    $cmd.ExecuteReader()
    # Set parameter for location of CSV file (so source file only needs to be listed once) as well as Worksheet Names.
    $sourceFile = ".\NewDocClass-XLS-Test.xlsx"
    # Add '@saccounty.net' suffix to samAccountName for UserPrincipalName
    $userPrincinpal = $_."samAccountName" + "@saccounty.net"
    # Combine GivenName & SurName for DisplayName
    $displayName = $_."sn_LastName" + ". " + $_."givenName_FirstName"
    # JRV Call the Get-ExcelSheet function, providing FileName and SheetName values
    # Pipe the data from source for remaining script.
    Get-ExcelSheet -filename "E:\AD_Bulk_Update\NewDocClass-XLS-Test.xlsx" -sheetName "Create DocClass Accts" | ForEach-Object {
    # Create and configure new AD User Account based on information from the CSV source file.
    Write-Host " "
    Write-Host " "
    Write-Host "Creating and configuring new user account from the CSV source file." -foregroundcolor Cyan # -backgroundcolor Black
    New-ADUser -Name ($_."sn_LastName" + ". " + $_."givenName_FirstName") `
    -SamAccountName $_."samAccountName" `
    -UserPrincipalName $userPrincinpal `
    -Path $_."TargetOU" `
    Below is the errors I get:
    Exception calling "Open" with "0" argument(s): "The 'Microsoft.Jet.OLEDB.4.0'
    provider is not registered on the local machine."
    At E:\AD_Bulk_Update\Create-BulkADUsers-XLS.ps1:39 char:6
    + $conn.open()
    + ~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException
    Exception calling "ExecuteReader" with "0" argument(s): "ExecuteReader
    requires an open and available Connection. The connection's current state is
    closed."
    At E:\AD_Bulk_Update\Create-BulkADUsers-XLS.ps1:40 char:6
    + $cmd.ExecuteReader()
    + ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException

  • How to create bulk user ids in the FIM 2010 using powershell

    i have the below powershell script but which will create only one user at time in the FIM. Can somebody help me with powershell scripit which will help us to create a bulk users .
     set-variable -name URI -value "http://localhost:5725/resourcemanagementservice' " -option constant
     function SetAttribute
        PARAM($object, $attributeName, $attributeValue)
        END
            $importChange = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange
            $importChange.Operation = 1
            $importChange.AttributeName = $attributeName
            $importChange.AttributeValue = $attributeValue
            $importChange.FullyResolved = 1
            $importChange.Locale = "Invariant"
            if ($object.Changes -eq $null) {$object.Changes = (,$importChange)}
            else {$object.Changes += $importChange}
     function CreateObject
        PARAM($objectType)
        END
           $newObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
           $newObject.ObjectType = $objectType
           $newObject.SourceObjectIdentifier = [System.Guid]::NewGuid().ToString()
           $newObject
     if(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation}
     clear-host
     if($args.count -ne 1) {throw "You need to specify your attribute values as parameter"}
     $attributes = ($args[0]).split("|")
     if(0 -ne [String]::Compare(($attributes[0]).split(":")[0],"displayname", $true))
     {throw "You need to specify a display name"}
     $objectName = ($attributes[0]).split(":")[1]
     $exportObject = export-fimconfig -uri $URI `
                                      –onlyBaseResources `
                                      -customconfig "/Person[DisplayName='$objectName']"
     if($exportObject) {throw "L:User $objectName already exists"}
     $newUser = CreateObject -objectType "Person"
     foreach($attribute in $attributes)
        $attrData = $attribute.split(":")
        SetAttribute -object $newUser `
                     -attributeName  $($attrData[0]) `
                     -attributeValue $($attrData[1])
     $newUser | Import-FIMConfig -uri $URI
     write-host "`nUser created successfully`n"
     trap
        $exMessage = $_.Exception.Message
        if($exMessage.StartsWith("L:"))
        {write-host "`n" $exMessage.substring(2) "`n" -foregroundcolor white -backgroundcolor darkblue}
        else {write-host "`nError: " $exMessage "`n" -foregroundcolor white -backgroundcolor darkred}
        Exit

    There's a good example on the
    FIM PowerShell Module CodePlex site.
    You could extend it by doing something like this:
    ### Create a sample CSV file
    FirstName, LastName, AccountName, DisplayName
    James, Bond, JamesBond, Agent
    James, Taylor, JamesTaylor, Quartet
    Wayne, Gretzky, WayneGretzky, The One
    '@ | Out-File -FilePath Users.csv
    ### Create the users in FIM
    foreach ($user in Import-Csv -Path Users.csv)
    New-FimImportObject -ObjectType Person -State Create -Changes @{
    DisplayName = $user.DisplayName
    AccountName = $user.AccountName
    FirstName = $user.FirstName
    LastName = $user.LastName
    Description = 'Have any grapes?'
    EmployeeType = 'Contractor'
    Domain = 'LITWARE'
    Email = "$($user.AccountName)@litware.ca"
    } -ApplyNow
    CraigMartin – Edgile, Inc. – http://identitytrench.com

  • Bulk Update Connected SharePoint Sites via powershell

    Hello
    Is there a way to Bulk Update Connected SharePoint Sites via powershell?
    Yasser

    Sure you can, call the following PSI method from PowerShell passing in the correct parameter values:
    http://msdn.microsoft.com/en-us/library/office/gg206217(v=office.15).aspx
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Office 365 UsageLocation, Bulk Powershell.

    Good afternoon Spiceheads!I am racking my brain on trying to use powershell to bulk change my O365 users usagelocation. The msExchangeUsageLocation is not an attribute in my AD i can changed/edit.I have spent a day or two googling, reading, testing, and have finally hit the wall. I wrote the below bit of powershell with the goal of querying O365 for users without a usage location, exporting them to a CSV, importing the CSV and for each user to be set to the usagelocation US.PowershellConnect-MsolServiceGet-msoluser -all | Where-Object {$_.UsageLocation -eq $Null} | Export-Csv C:\scripts\Users.csv$users = "C:\scripts\users.csv"Import-CSV $users$usagelocation = "US"ForEach ($user in $users){$user1 = "$user.UserPrincipalName"$objectID = "$user.ObjectID"Set-Msoluser -ObjectId $objectID -UserPrincipalName $user1 -UsageLocation "US"}The...
    This topic first appeared in the Spiceworks Community

    I found the below article which might help point you in the right direction....
    http://technet.microsoft.com/en-us/library/dn530773.aspx
    Be kind and Mark as Answer if I helped.

Maybe you are looking for

  • System lock ups / cannot start system

    Hello, I am using Slimline S5648HK. I have been using the PC for over a year and a half now, and  recently I am having trouble with the PC locking up / weird screen (Some fuzzy colors) and it auto reboot. In most cases, it occures when watching video

  • PROBLEM  BAPI_SALESORDER_CREATEFROMDAT2 condvalue

    Dear all, We have an issue with BAPI BAPI_SALESORDER_CREATEFROMDAT2. We try change the value for the field condition KONV-KWERT with the following field from the bapi CONDITIONS_IN-CONDVALUE. The condition to  modify is a percentage condition. We can

  • WebDynpro or JSPDynPage with HTMLB

    We'd like to develop JavaApplications (PortalService, EJB,..) that will be called through a Portal-iView. Some people from SAP say that it is better to use Java-iViews for frontend and others say that WebDynpro is strategic. When looking at it, Java-

  • Lining up tracks? Disable grid function? HELP

    Okay, being new to the program I did something stupid (deleted a portion of my track when I simply could have silenced it or taken another approach), and caused it to move out of sync. I didn't record to a metronome, so to get it lined up with the ot

  • Overriding mobile theme CSS

    I would like to customize the CSS of a mobile theme generated by a Wordpress plugin which converts a non-responsive design to a mobile version of the site. But it's a pain because I have to go through the entire stylesheet in order to find out what C