-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search-TssMetadataHistory - new command
- Loading branch information
Showing
6 changed files
with
391 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# Search-TssMetadataHistory | ||
|
||
## SYNOPSIS | ||
Search metadata history | ||
|
||
## SYNTAX | ||
|
||
### item | ||
``` | ||
Search-TssMetadataHistory [-TssSession] <Session> -ItemId <Int32> -ItemType <MetadataType> [-EndDate <String>] | ||
[-StartDate <String>] [-SortBy <String>] [<CommonParameters>] | ||
``` | ||
|
||
### field | ||
``` | ||
Search-TssMetadataHistory [-TssSession] <Session> [-FieldId <Int32>] [-EndDate <String>] [-StartDate <String>] | ||
[-SortBy <String>] [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
Search metadata history | ||
|
||
## EXAMPLES | ||
|
||
### EXAMPLE 1 | ||
``` | ||
$session = New-TssSession -SecretServer https://alpha -Credential $ssCred | ||
Search-TssMetadataHistory -TssSession $session -ItemId 5 -ItemType User | ||
``` | ||
|
||
Returns history of all metadata fields for User ID5 | ||
|
||
## PARAMETERS | ||
|
||
### -TssSession | ||
TssSession object created by New-TssSession for authentication | ||
|
||
```yaml | ||
Type: Session | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 1 | ||
Default value: None | ||
Accept pipeline input: True (ByValue) | ||
Accept wildcard characters: False | ||
``` | ||
### -ItemId | ||
Item ID to return metadata | ||
```yaml | ||
Type: Int32 | ||
Parameter Sets: item | ||
Aliases: | ||
|
||
Required: True | ||
Position: Named | ||
Default value: 0 | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -ItemType | ||
Item Type (Secret, User, Folder, Group) | ||
```yaml | ||
Type: MetadataType | ||
Parameter Sets: item | ||
Aliases: MetadataType | ||
Accepted values: Secret, User, Folder, Group | ||
|
||
Required: True | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -FieldId | ||
Metadata Field ID | ||
```yaml | ||
Type: Int32 | ||
Parameter Sets: field | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: 0 | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -EndDate | ||
Return history only entered before this time | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -StartDate | ||
Return history only entered after this time | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -SortBy | ||
Sort by specific property, default ItemId | ||
```yaml | ||
Type: String | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: False | ||
Position: Named | ||
Default value: ItemId | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
## OUTPUTS | ||
### Thycotic.PowerShell.Metadata.History | ||
## NOTES | ||
Requires TssSession object returned by New-TssSession | ||
## RELATED LINKS | ||
[https://thycotic-ps.github.io/thycotic.secretserver/commands/metadata/Search-TssMetadataHistory](https://thycotic-ps.github.io/thycotic.secretserver/commands/metadata/Search-TssMetadataHistory) | ||
[https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/metadata/Search-TssMetadataHistory.ps1](https://github.com/thycotic-ps/thycotic.secretserver/blob/main/src/functions/metadata/Search-TssMetadataHistory.ps1) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using System.Management.Automation; | ||
using System.Management.Automation.Runspaces; | ||
using Thycotic.PowerShell.Enums; | ||
|
||
namespace Thycotic.PowerShell.Metadata | ||
{ | ||
public class History | ||
{ | ||
public DateTime? CreateDateTime { get; set; } | ||
public int CreateUserId { get; set; } | ||
public string CreateUserName { get; set; } | ||
public int ItemId { get; set; } | ||
public MetadataFieldDataType MetadataFieldDataType { get; set; } | ||
public int MetadataFieldId { get; set; } | ||
public string MetadataFieldName { get; set; } | ||
public int MetadataFieldSectionId { get; set; } | ||
public string MetadataFieldSectionName { get; set; } | ||
public string MetadataFieldTypeName { get; set; } | ||
public int MetadataItemDataHistoryId { get; set; } | ||
public int MetadataItemDataId { get; set; } | ||
public MetadataType MetadataType { get; set; } | ||
public string MetadataTypeName { get; set; } | ||
public int SortOrder { get; set; } | ||
public bool ValueBit { get; set; } | ||
public DateTime? ValueDateTime { get; set; } | ||
public int ValueInt { get; set; } | ||
public double ValueNumber { get; set; } | ||
public string ValueString { get; set; } | ||
public string ValueUserDisplayName { get; set; } | ||
} | ||
} |
Oops, something went wrong.