Powershell variable

Hi
Is it possible to define a new powershell variable by using the form:
$test="Hello"
$Name = ("$" + "$test" + "webapFeature")
When i type $name afterwards in PowerShell i get:
$Hellowebapfeature
But this has not been defined as a variable properly. I cant type: "$Hell" then tab to the whole "$Hellowebapfeature"
Any ideas how to do this?
The reason behind this is that i want to create several different variables in a function.
brgs
Bjorn

Solved it :)
$Name = ("test" + "webapFeature")
new-variable -name $Name
-value "yo local"
This creates a variable: $testwebapFeature
with value "yo local"

Similar Messages

  • PowerShell - Variable Evaluation in Return

    OK, so I'm working with the registry, specifically the user's %PATH%. I am creating user variables, and adding these variables to the PATH.  I would like to be able to query the registry, but see the variable name's, not what they evaluate to.
    For example:
    (Get-ItemProperty 'HKCU:\Environment').PATH
    Actual Return:
    C:\test1;C:\test2
    I want to return:
    %VALUE1%;%VALUE2%
    I have added values to the path as %VALUE1%;%VALUE2%, and both values are set as user variables.  What I would like to do is construct a PowerShell registry query that will return %VALUE1%;%VALUE2% instead of the actual set values for these variables. 
    Is this possible?

    Get-Member -InputObject (Get-Item 'HKCU:\Environment') -Name GetValue | FL
    TypeName : Microsoft.Win32.RegistryKey
    Name : GetValue
    MemberType : Method
    Definition : System.Object GetValue(string name), System.Object GetValue(string name, System.Object defaultValue), System.Object
    GetValue(string name, System.Object defaultValue, Microsoft.Win32.RegistryValueOptions options)
    [System.Enum]::GetNames([Microsoft.Win32.RegistryValueOptions])
    None
    DoNotExpandEnvironmentNames
    (get-Item 'hkcu:\Environment').GetValue("TMP")
    C:\Users\User\AppData\Local\Temp
    (get-Item 'hkcu:\Environment').GetValue("TMP","Default",[Microsoft.WIN32.RegistryValueOptions]::DoNotExpandEnvironmentNames)
    %USERPROFILE%\AppData\Local\Temp

  • Powershell Variable from Excel.VBA Macro

    Hi Guys!
    I don't know if what i'm asking you is achievable.
    I've learned how to pass variables/arguments from powershell to Excel/VBA Macro but i need to do the opposite thing.
    This is an example of what  i want:
    Powershell                                                                      
                       Excel/VBA Macro
    $Input=1   ---------------------------------------------------------------->   Sub Macro(input)
    $excel.Run("Macro",$Input)                                                              
      Output=input +6
    $output (Expected 7)   <----------------------------------------------------  return Output
    I don't know how to do this can you help me please?
    A

    Ok guys those are the script.
    Macro:
    Sub CreatePWD()
    Dim PWD As String
    Dim i As Integer
    Dim Max As Integer
    Dim F1 As Worksheet
    Set F1 = ThisWorkbook.Worksheets("Foglio1")
    Max = F1.Range("A1").Value
    For i = 1 To Max
    If Int((2 * Rnd) + 1) = 1 Then
    PWD = PWD & Chr(Int((90 - 65 + 1) * Rnd + 65))
    Else
    PWD = PWD & Int((9 - 0 + 1) * Rnd + 0)
    End If
    Next i
    MsgBox PWD
    End Sub
    Powershell:
    $Excel = New-Object -ComObject excel.application
    $Excel.visible=$false
    $Version = "C:\Users\Alberto Corona\Desktop\Cartel1.xlsm"
    $WorkBook= $Excel.workbooks.open($Version)
    $WorkSheet= $WorkBook.worksheets.item(1)
    $WorkSheet.cells.item(1,1)=5
    $Excel.Run("CreatePWD")
    $WorkBook.save()
    $WorkBook.close()
    $Excel.quit()
    The result of macro is like "52UT7" i want a variable in powershell called $PWD that contain the value of the macro. 
    Hope the problem is clear now.
    Thanks
    A

  • Store DisplayName as a Powershell Variable

    Good day All,
    I am attempting to create a script that watches a user account for a change in name. The reason is long, and unimportant, but I have created an automated script to log into Office 365, and get the user properties using 
    $checkName = Get-User -Identity [email protected] | FL DisplayName
    But, when I do:
    Write-Host $checkName
    It gives me: 
    Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData Microsoft.PowerShell.Commands.Internal.Format.FormatEndData
    That. No idea why. Does anyone have any ideas on how to accomplish this? What I'm looking for is to keep the output, which looks like this when I do it in the shell:
    PS C:\Windows\system32> Get-User -Identity [email protected] | FL DisplayName
    DisplayName : First Last
    PS C:\Windows\system32>
    to save as just "DisplayName : First Last" so that I can compare it using:
    if($checkName -like "DisplayName : First Last"){
    $Result = "Name is Good!"
    $NagiosStatus = "0"
    }else{
    $Result = "NAME HAS CHANGED!!"
    $NagiosStatus = "1"
    To eventually be able to configure Nagios to watch it? I know this is a weird request, but sometimes weird things must be done. Thank you in advance for any help you can provide!
    -Ricky

    This is so cool, and works perfectly! Thank you so much for the help!
    For anyone else who may be looking to do the same, I'll add my script with comments, so you can preform the whole of what I'm going to do as well. I've not completely finished tweaking it to work in Nagios, and I may update it after it does so others can
    use it as well, but here it is as it currently reports:
    # Nagios Username Detection Script
    # Author: Ricky and some other templates I've used online
    # Version 0.1
    # Will be updated once working to version 1.0
    # Compatibility:
    # Nagios Version: 3.x.4.x
    # Exchange Version: Office 365 2013
    # Powershell Version: 2.0
    # NSClient++ Version: 4.x
    #——– User ———–
    $user = “[email protected]
    #——– Password: SECURE - Use a secure string for authentication, required secure string to be made ———–
    $pass = Get-Content C:\Users\user\Documents\WindowsPowerShell\SecureStrings\365securestring.txt | convertto-securestring
    $credential = New-Object System.Management.Automation.PsCredential($user, $pass)
    # Link to description of creating secure string: http://community.office365.com/en-us/f/148/t/81993.aspx
    # Command to create a secure string: read-host -prompt "Enter password to be encrypted in mypassword.txt " -assecurestring | convertfrom-securestring | out-file C:\Users\...\365securestring.txt
    #——– Import office 365 Cmdlets ———–
    Import-Module MSOnline
    #———— Establish an Remote PowerShell Session to office 365 ———————
    Connect-MsolService -Credential $credential
    #———— Establish an Remote PowerShell Session to Exchange Online ———————
    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" -AllowRedirection
    #———— Set the warning prefrence to prevent output from connecting
    $WarningPreference = "SilentlyContinue"
    #———— This command that we use for implicit remoting feature of PowerShell 2.0 ———————
    Import-PSSession $session | Out-Null
    $checkName = Get-User -Identity [email protected] | select DisplayName
    if($checkName.displayname -eq "First Last"){
    $Result = "Name is Good!"
    $NagiosStatus = "0"
    }else{
    $Result = "NAME HAS CHANGED!!"
    $NagiosStatus = "1"
    Write-Host $Result
    Write-Host $NagiosStatus
    Thank you again Amit for your help! SO EXCITED TO HAVE THIS DONE!!
    -Ricky

  • Powershell Variables

    Hello there,
    I have a code in a following way:
    $a = "1234"$b = "`$a"$a
    $b
    The Output of this code is:
    1234
    $a
    Is it possible to use variable $b to get the content of variable $a when variable b includes variable a itself?  Something like that
    *somestring* $b
    Output of this should be: 1234
    Thank you very much for help!
    Regards
    Christoph

    Hi,
    @Mike: you are right. This is working with that code. But I would like to read out the information out of a file. The file got the following content:
    Submitter | 550000010 | c | 30 | $AR_SUBMITTER
    I would like to use the $AR_SUBMITTER variable in my own code.
    For that I use the following code:
    FUNCTION getFile ($path)
    $input = Get-Content $path | select-string -notmatch "#"
    foreach ($line in $input)
    $separator = $line.line.split("|")
    $database_name = $separator[0].Trim()
    $database_id = $separator[1].Trim()
    $data_type = $separator[2].Trim()
    $maximum_length = $separator[3].Trim()
    $value = $separator[4].Trim()
    return $value
    $AR_SUBMITTER = "123"
    $path = "file.txt"
    $Output = getFile($path)
    $AR_SUBMITTER
    $test = """$Output"""
    $test$test2 = (get-item Variable:$Output).Value
    $test2
    The Output here is:
    123
    "$AR_SUBMITTER"
    @Bill: I can't use the get-item-option. For that I got the following error-Code:
    Get-Item can't find path "Variable:\$AR_Submitter
    Thanks for your help!
    Regards
    Christoph

  • Extract Variables from Powershell Script

    Hey Guys
    I am building a workflow that sync's active directory to the IAC database and i am looking to make it as efficient as possible by reducing the amount of powershell scripts I use into one and then utilise the powershell variables to get what i need.
    Is it possible to extract the stored variables into a workflow variable as opposed to using the output of the powershell statement?
    Has anyone else built a workflow that sync's users to a DB that runs efficiently possible on the when modified date at the moment mine takes 28 minutes to sync 200 users.
    Matt

    From a design perspective, I would suggest to use the Generic OLEDB database adapter.  There is an OleDB provider for Active Directory called ADsDSOObject. You can find it through a search on the Microsoft site.  It may be installed as a part of standard Windows or .Net.  Not sure. If you could get this registered on the PO server, you would be able to do a select and use the output as a native table instead of Powershell output parsing.
    Powershell tends to be non-performant.  Definitely I would caution against calling PowerShell repeatedly in a loop.

  • Powershell to Query expiring accounts and then email

    Check: AD Notify users x days in advance that their password will expire
    A Powershell script. Sorry but I can't get a hyperlink to work in the mobile app.

    Ok, so I am looking to create a script to query expired/expiring accounts and then send an email with the new found info. The email part I have done a couple times before, works like a charm. The problem I am having is figuring out how to pipe the output from each query into a variable that I can call later on in the script to insert into the email.Powershell# Variables that we will use later$date = Get-Date $now = $date.ToFileTime() $ou = "OU=example,OU=example,DC=example,DC=com" # This section will output all expired accounts in the predefined OU "`nExpired" $root = [ADSI]"" $search = [adsisearcher]$root $search.Filter = "(&(objectclass=user)(objectcategory=user)(accountExpires>=1)(accountExpires

  • Powershell script error adding integers

    Hi All, I am trying to add integers but the script is not running. I am using variable "a" with the same line of thinking as
    $arg in $args
    $a in $as
    #  create a script thats adds numbers using foreach
    # put an if statement if the numbers are not valid
    My script begins here:
       set-psdebug -strict
        $total = 0
    foreach($a in $as)
                   if ( $a -as[int] -eq $null)
                { Write-host "this is not a valid number"
                    exit 1
                    $total += $a
                  Write-host "The total is $total"
    I am calling my script with the following line: .\finalexam\foreachadd.ps1 6 6 i
    The error is :
    The variable '$as' cannot be retrieved because it has not been set.
    At C:\cmd.practise\finalexam\foreachadd.ps1:8 char:15
    + foreach($a in $as)
    +               ~~~
        + CategoryInfo          : InvalidOperation: (as:String) [], RuntimeException
        + FullyQualifiedErrorId : VariableIsUndefined
    Thank-you
    SQL 75
    (LearningPowerhsell)

    You need to go back and study the very initial basics of PowerShell.  You are repeatedly guessing wrong and misunderstanding how this works. Without the fundamentals you will be forever lost.
    Try to understand why and how the following works.  Read the basics of using PowerShell variables and loops.
    $as=1,2,'x',4,5,'z'
    $total=0
    foreach($a in $as){
    if($a -as [int]){
            $total+=$a
    }else{
            Write-host "$a cannot be converted to a valid integer 32"
    Write-host "The total is $total"
    You also need to learn how to format your code.  Tat would make it easier for you too see your mistakes.
    \_(ツ)_/

  • How to change the font and background color in PowerShell

    From your error messages to your output parameters, changing the colors of different PowerShell variables and outcomes is a straightforward and useful way to customize your PowerShell console. You can quickly identify ouputs, error messages, parameters and more with simple color cues – and when you're dealing with a longer script, being able to quickly identify anything is a huge help.In aguide on how to configure and customize your color settingsin PowerShell, Petri walks through each and every step, and even donates some of itsown custom PowerShell color themes scripts. (It should be noted that this only works for PowerShell console and not PowerShell ISE.) You can access your color configuration by entering:Powershell$host.privatedataThis will pull up a list of all your colors as they are currently set.Image credit:Jeff HicksNow...
    This topic first appeared in the Spiceworks Community

    Use a custom Renderer. This is the JTable tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Copy text from sharepoint site

    Hi
    Is there any way to copy text on a sharepoint site like the health analyser overview to a text file or to a powershell variable?
    So just basically the text you see on the site.
    I want to use the copied (text) content afterwards.
    brgs
    Bjorn

    Hi Bjorn,
    Yes this is possible, but depends which information you want. The Health analyzer is a list, so you can use PowerShell to retrieve all list items and export them to a txt file.
    For regular text (like on a content web part) I am not sure how to do this, as I never had this requirement, but it should be possible as well.
    Nico Martens
    SharePoint/Office365/Azure Consultant

  • HOW TO: Use SIP Trunking to Keep your Telecoms System Up and Running

    Hello guys,
    Here's the deal:
    We had a major HDD fault in a laptop the other day... Pretty messy, (the laptop
    was our chief accountant's, and she's a paranoid x) ) as most of the data on
    the hard drive was invaluable. Using a recovery software, however, we've
    managed to get out about 80% of the info and transfered it to a mobile HDD.
    Almost everything is alright, except for a few xls/doc files that seem to be
    badly damaged. I want to ask if it's possible to somehow repair these files. I
    did try few repair programs, but none of them seems to even detect that the
    files are damaged. I've attached one of these files, please take a look and
    tell me if there's any hope (personally I think it's irreparable, but
    still...).

    From your error messages to your output parameters, changing the colors of different PowerShell variables and outcomes is a straightforward and useful way to customize your PowerShell console. You can quickly identify ouputs, error messages, parameters and more with simple color cues – and when you're dealing with a longer script, being able to quickly identify anything is a huge help.In aguide on how to configure and customize your color settingsin PowerShell, Petri walks through each and every step, and even donates some of itsown custom PowerShell color themes scripts. (It should be noted that this only works for PowerShell console and not PowerShell ISE.) You can access your color configuration by entering:Powershell$host.privatedataThis will pull up a list of all your colors as they are currently set.Image credit:Jeff HicksNow...

  • Lync management shell Filterable properties

    Did MS ever write the Lyn server 2013-equivalent version of this Exchange server list:
    Filterable Properties for the -Filter Parameter
    https://technet.microsoft.com/en-us/library/bb738155%28v=exchg.141%29.aspx

    Eason Huang:
    Are you serious? Just LOL! How did you check that no such document exists, if you arent even sure Lync support -Filter parameter or not?
    For your benefit, here is some material to read:
    https://technet.microsoft.com/en-us/library/gg398125.aspx -->Get-CsUser
    Parameter: FILTER:
    Enables you to limit the returned data by filtering on Lync Server-specific attributes. For example, you can limit returned data to users who have been assigned a specific voice policy, or users who have not been assigned a specific voice policy.
    The Filter parameter uses the same Windows PowerShell filtering syntax that is used by the Where-Object cmdlet. For example, a filter that returns only users who have been enabled for Enterprise Voice would look like this, with EnterpriseVoiceEnabled representing
    the Active Directory attribute, -eq representing the comparison operator (equal to), and $True (a built-in Windows PowerShell variable) representing the filter value:
    {EnterpriseVoiceEnabled -eq $True}

  • Comparing count and combined file sizes of specific file types in target folder and subfolders

    Hi all,
    I have a script that I use to delete files with a certain file extension in a folder and its subfolders. I would like to enhance to the script by counting the total number of files and their combined size in MB that the script is deleting and use this information
    in a popup where a message will say something like "X No. Files deleted totalling YMB
    The existing script so far is:
    get-childitem  -include *.****.rfa -recurse | foreach ($_) {remove-item $_.fullname}
    Can any advise what I need to add as I'm quite new to powershell.
    Thanks

    So you do not know how to write a simple output statement.  I think you need to start here:
    http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
    Not specifically within Powershell no, like I said I only started looking at it this week as an alternative to VBS.
    Nothing is being declared.  You need to learn the basics of PowerShell.  We cannot teach you one line at a time.
    Really? So the author of
    this website is talking rubbish is he? ("Once data is assigned to a PowerShell variable, it’s automatically declared.")
    I never asked for line-by-line hand holding nor am I someone who wants others to write the entire code for me. Examples of previous scripts that perform similar or partial operations would have been a good way to guide a new user unfamiliar to this topic.
    Additionally posting modified(incorrect) and unfinished script examples without clearly stating what your code is doing nor that additional lines of code need to be added before the script will operate as outlined in the original post is confusing to someone
    with 0 experience in this area.
    On forums I frequent that are relevant to subjects which I have good experience with, whenever I respond to a genuine query of that has an example of what they are trying to create/modify, I will happily provide a full example and/or explain what I
    have done so the OP understands exactly what I did to achieve their request in my example. For someone with your points tally (and likely a respected poster amongst your peers on this site) responding with what is essentially "RFTM Noob" I trust you can understand
    is somewhat disappointing.

  • 5530 How to use SIP

    I did all the settings to use SIP, the last step is to make a internetphone link.
    How can i make this internet phone link so i can make calls with SIP ?
    Thx.
    Realblackadder

    From your error messages to your output parameters, changing the colors of different PowerShell variables and outcomes is a straightforward and useful way to customize your PowerShell console. You can quickly identify ouputs, error messages, parameters and more with simple color cues – and when you're dealing with a longer script, being able to quickly identify anything is a huge help.In aguide on how to configure and customize your color settingsin PowerShell, Petri walks through each and every step, and even donates some of itsown custom PowerShell color themes scripts. (It should be noted that this only works for PowerShell console and not PowerShell ISE.) You can access your color configuration by entering:Powershell$host.privatedataThis will pull up a list of all your colors as they are currently set.Image credit:Jeff HicksNow...

  • Exchange Powershell return value from Get-command to variable.

    Hi
    I am trying to create a powershell-script for our monitoring-software.
    The script is supposed to establish a connection to our exchange-server mgmt-shell and execute this command:
    "Get-MailboxDatabaseCopyStatus"
    I have the connection in place, but am missing the knowledge of how to return the result of the command to my script, which I can then pass to our monitoring-software.
    (The script take 2 parameters - host and command eg. exch01.domain and Get-MailboxDatabaseCopyStatus).
    Current code:
    $statusAlive = "ScriptRes:Host is alive:"
    $statusDead = "ScriptRes:No answer:"
    $statusUnknown = "ScriptRes:Unknown:"
    $statusNotResolved = "ScriptRes:Unknown host:"
    $statusOk = "ScriptRes:Ok:"
    $statusBad = "ScriptRes:Bad:"
    $statusBadContents = "ScriptRes:Bad contents:"
    $pass = cat C:\securestring.txt | convertto-securestring
    $Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist "domain\administrator",$pass
    $host = $args[0]
    $command = $args[1]
    <#
    if (!$args[0]) {
    echo $statusUnknown"Host parameter is empty"
    exit
    if (!$args[1]) {
    echo $statusUnknown"Command parameter is empty"
    exit
    #>
    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://$host/powershell -Credential $cred
    Import-PSSession $session
    $command
    Remove-PSSession $session
    Now, how do I "catch" the value of the executed command and return it to a variable in the script?
    Best Regards,
    Soren

    Hmm.. doesnt seem to work quite right.
    I added "Echo $result" after "Remove-PSSession $session", but then I just get a bunch of information..
    Script tmp_c3a1c132-f4d9-4d61... {Get-IRMConfiguration, New-MailUser, Get-PublicFolderMigrationRequestSta...
    RunspaceId : 2d179364-2df3-483d-a192-f5f4ca9453bb
    Identity : DB02 - Specielle\EXCHANGE01
    Id : DB02 - Specielle\EXCHANGE01
    Name : DB02 - Specielle\EXCHANGE01
    DatabaseName : DB02 - Specielle
    Status : Mounted
    InstanceStartTime : 01-03-2014 03:35:07
    LastStatusTransitionTime :
    MailboxServer : EXCHANGE01
    ActiveDatabaseCopy : EXCHANGE01
    ActiveCopy : True
    ActivationPreference : 1
    StatusRetrievedTime : 11-03-2014 08:30:15
    WorkerProcessId : 8124
    ActivationSuspended : False
    ActionInitiator : Unknown
    ErrorMessage :
    ErrorEventId :
    ExtendedErrorInfo :
    SuspendComment :
    RequiredLogsPresent :
    SinglePageRestore : 0
    ContentIndexState : Healthy
    ContentIndexErrorMessage :
    ContentIndexVersion : 1
    ContentIndexBacklog : 0
    ContentIndexRetryQueueSize : 0
    ContentIndexMailboxesToCrawl :
    ContentIndexSeedingPercent :
    ContentIndexSeedingSource :
    CopyQueueLength : 0
    ReplayQueueLength : 0
    ReplaySuspended : False
    ResumeBlocked : False
    ReseedBlocked : False
    MinimumSupportedDatabaseSchemaVersion : 0.121
    MaximumSupportedDatabaseSchemaVersion : 0.125
    RequestedDatabaseSchemaVersion : 0.125
    LatestAvailableLogTime :
    LastCopyNotificationedLogTime :
    LastCopiedLogTime :
    LastInspectedLogTime :
    LastReplayedLogTime :
    LastLogGenerated : 0
    LastLogCopyNotified : 0
    LastLogCopied : 0
    LastLogInspected : 0
    LastLogReplayed : 0
    LowestLogPresent : 0
    LastLogInfoIsStale : False
    LastLogInfoFromCopierTime :
    LastLogInfoFromClusterTime :
    LastLogInfoFromClusterGen : 0
    LogsReplayedSinceInstanceStart : 0
    LogsCopiedSinceInstanceStart : 0
    LatestFullBackupTime :
    LatestIncrementalBackupTime :
    LatestDifferentialBackupTime :
    LatestCopyBackupTime :
    SnapshotBackup :
    SnapshotLatestFullBackup :
    SnapshotLatestIncrementalBackup :
    SnapshotLatestDifferentialBackup :
    SnapshotLatestCopyBackup :
    LogReplayQueueIncreasing : False
    LogCopyQueueIncreasing : False
    ReplayLagStatus :
    DatabaseSeedStatus :
    OutstandingDumpsterRequests : {}
    OutgoingConnections :
    IncomingLogCopyingNetwork :
    SeedingNetwork :
    DiskFreeSpacePercent : 50
    DiskFreeSpace : 20.02 GB (21,498,761,216 bytes)
    DiskTotalSpace : 40 GB (42,946,523,136 bytes)
    ExchangeVolumeMountPoint :
    DatabaseVolumeMountPoint : E:\
    DatabaseVolumeName : \\?\Volume{e6cb407f-e4f2-11e2-93eb-005056ae239d}\
    DatabasePathIsOnMountedFolder : False
    LogVolumeMountPoint : F:\
    LogVolumeName : \\?\Volume{e6cb4087-e4f2-11e2-93eb-005056ae239d}\
    LogPathIsOnMountedFolder : False
    LastDatabaseVolumeName :
    LastDatabaseVolumeNameTransitionTime :
    VolumeInfoError :
    IsValid : True
    ObjectState : Unchanged
    RunspaceId : 2d179364-2df3-483d-a192-f5f4ca9453bb
    Identity : DB01 - Standard\EXCHANGE01
    Id : DB01 - Standard\EXCHANGE01
    Name : DB01 - Standard\EXCHANGE01
    DatabaseName : DB01 - Standard
    Status : Mounted
    InstanceStartTime : 01-03-2014 03:35:07
    LastStatusTransitionTime :
    MailboxServer : EXCHANGE01
    ActiveDatabaseCopy : EXCHANGE01
    ActiveCopy : True
    ActivationPreference : 1
    StatusRetrievedTime : 11-03-2014 08:30:15
    WorkerProcessId : 8140
    ActivationSuspended : False
    ActionInitiator : Unknown
    ErrorMessage :
    ErrorEventId :
    ExtendedErrorInfo :
    SuspendComment :
    RequiredLogsPresent :
    SinglePageRestore : 0
    ContentIndexState : Healthy
    ContentIndexErrorMessage :
    ContentIndexVersion : 1
    ContentIndexBacklog : 3
    ContentIndexRetryQueueSize : 0
    ContentIndexMailboxesToCrawl :
    ContentIndexSeedingPercent :
    ContentIndexSeedingSource :
    CopyQueueLength : 0
    ReplayQueueLength : 0
    ReplaySuspended : False
    ResumeBlocked : False
    ReseedBlocked : False
    MinimumSupportedDatabaseSchemaVersion : 0.121
    MaximumSupportedDatabaseSchemaVersion : 0.125
    RequestedDatabaseSchemaVersion : 0.125
    LatestAvailableLogTime :
    LastCopyNotificationedLogTime :
    LastCopiedLogTime :
    LastInspectedLogTime :
    LastReplayedLogTime :
    LastLogGenerated : 0
    LastLogCopyNotified : 0
    LastLogCopied : 0
    LastLogInspected : 0
    LastLogReplayed : 0
    LowestLogPresent : 0
    LastLogInfoIsStale : False
    LastLogInfoFromCopierTime :
    LastLogInfoFromClusterTime :
    LastLogInfoFromClusterGen : 0
    LogsReplayedSinceInstanceStart : 0
    LogsCopiedSinceInstanceStart : 0
    LatestFullBackupTime :
    LatestIncrementalBackupTime :
    LatestDifferentialBackupTime :
    LatestCopyBackupTime :
    SnapshotBackup :
    SnapshotLatestFullBackup :
    SnapshotLatestIncrementalBackup :
    SnapshotLatestDifferentialBackup :
    SnapshotLatestCopyBackup :
    LogReplayQueueIncreasing : False
    LogCopyQueueIncreasing : False
    ReplayLagStatus :
    DatabaseSeedStatus :
    OutstandingDumpsterRequests : {}
    OutgoingConnections :
    IncomingLogCopyingNetwork :
    SeedingNetwork :
    DiskFreeSpacePercent : 50
    DiskFreeSpace : 20.02 GB (21,498,761,216 bytes)
    DiskTotalSpace : 40 GB (42,946,523,136 bytes)
    ExchangeVolumeMountPoint :
    DatabaseVolumeMountPoint : E:\
    DatabaseVolumeName : \\?\Volume{e6cb407f-e4f2-11e2-93eb-005056ae239d}\
    DatabasePathIsOnMountedFolder : False
    LogVolumeMountPoint : F:\
    LogVolumeName : \\?\Volume{e6cb4087-e4f2-11e2-93eb-005056ae239d}\
    LogPathIsOnMountedFolder : False
    LastDatabaseVolumeName :
    LastDatabaseVolumeNameTransitionTime :
    VolumeInfoError :
    IsValid : True
    ObjectState : Unchanged
    I am only interested in the 2 "ContentIndexState" - how can I pick these 2 out and put them into a variable?
    I though the command "Get-MailboxDatabaseCopyStatus" would only display these two, since it is what happens if I run the command inside PowerShell on the server itself.

Maybe you are looking for

  • My Date Scriplet worked fine until now

    Can you please take a look at my date scriplet I wrote for a jsp page? It gives the current month, day, and year but for some reason it is saying March 16, 2002 instead of May 16, 2002. Any ideas would be greatly appreciated. Thanks, panatha <%@page

  • Crystal Report is very slow to fetch the results of a Query used in Command

    Hello All, We have a query which is used in command object in Business Objects Crystal reports XI. This report is executed against IBM DB2 database. It is taking 40 min to getback the results. Here is the Query. Please suggest how can i improve the p

  • Include line item number in printout of PO

    Hello all, I would like to verify as to how I can include the line item number of the specified materials on printout of a PO? What needs to be done? Thanks.

  • Synchronization Issues

    This has situation has happen to me twice.  I was trying to install at ringtone on my IPhone 4 last night and somewhere in the process there was a synchoization issue that really destroyed what information I had in my phone.  All of my contacts were

  • Where is the best place to buy a new battery?

    I have a G4 PowerBook, 15", that needs a new battery. Where is the best placeto buy one? Does a new battery still require conditioning?