mbegan / Okta-PSModule

Okta API Powershell Wrapper Module
Other
102 stars 31 forks source link

OktaListLogs #38

Closed Saikishore031 closed 5 years ago

Saikishore031 commented 5 years ago

Hi Team,

Could you please help me to provide example list of parameters am facing an error while trying to execute the OktaListLogs script OktaListLogs

Saikishore031 commented 5 years ago

Could you please provide me example parameters which I want to give on right hand side

mbegan commented 5 years ago

Take a look at the Filtering Results section of the system log API docs for more detail.

I can't see the entirety of the query you are sending through but I gather you are trying to filter for a specific eventType.

Here is how i would format the SCIM Filter for Okta to process.

-filter 'eventType eq "user.lifecycle.deactivate"'

the single quote is important for powershell to see the entire string as the value for the filter parameter. The double quotes inside of the singles are important for Okta to parse the SCIM filter.

PS /> $logs = oktaListLogs -filter 'eventType eq "user.lifecycle.deactivate"'
PS /> $logs[0]                                                                                                                                                                                                                                                                                                                                                                                                                                                          actor                 : @{id=00u8tvgeu9PoK3xRB0h7; type=User; alternateId=mbegan@okta.com; displayName=Matthew Egan; detailEntry=}                      
client                : @{userAgent=; zone=null; device=Computer; id=; ipAddress=65.130.171.185; geographicalContext=}
authenticationContext : @{authenticationProvider=; credentialProvider=; credentialType=; issuer=; interface=; authenticationStep=0; 
                        externalSessionId=102Y7ZwFCMiQsSDMu4HBXP8Qw}
displayMessage        : Deactivate Okta User
eventType             : user.lifecycle.deactivate
outcome               : @{result=SUCCESS; reason=}
published             : 4/28/19 2:46:34 PM
securityContext       : @{asNumber=; asOrg=; isp=; domain=; isProxy=}
severity              : INFO
debugContext          : @{debugData=}
legacyEventType       : core.user.config.user_deactivated
transaction           : @{type=WEB; id=XMW8yZzWXpDwReJqUJi-CQAAB2c; detail=}
uuid                  : 2c31e44a-e528-4093-a061-d81e269786f3
version               : 0
request               : @{ipChain=System.Object[]}
target                : {@{id=00ujtehwdhkAoAzpk0h7; type=User; alternateId=SizingtestB110@sizer.tld; displayName=Sizing testB110; detailEntry=}}
Saikishore031 commented 5 years ago

Hi friend,

Still facing the Same issue "Method Invocation failed because [system.uribuilder] does not contain a method named 'new'. Please help me in this regards.

OktaListLogs

mbegan commented 5 years ago

What version of powershell are you running?

Check the prereqs for more info, you need to be running version 4 or greater.

Saikishore031 commented 5 years ago

I have powershell v4.0

mbegan commented 5 years ago

I'm stumped.

Can you get me some additional context.

Are you able to run any commands?

Run something basic like oktaGetUserbyID -userName me to confirm that everything is setup right.

The errors in the screenshot are complaining about missing classes that should be a part of .Net or the OS.

Can you provide the complete output from this

PS > $Error.Clear()
PS > $oktaVerbose=$true  
PS > $logs = oktaListLogs -sinceDaysAgo 1 -Verbose
PS > $Error[0..($Error.count)]