Search-Mailbox cmdlet in Exchange 2013 - exchange-server

I sent a email from administrator to a user usertest4 with title and body: 'aaaaaaa'.
Waiting 5 minutes then i execute this script:
Search-Mailbox -Identity 'usertest4' -SearchQuery {(From:"*admin*" AND Body:"*h*" AND Received<= "05/16/2021 05:16")} -EstimateResultOnly -Confirm:$False -Force:$true
Result return:
RunspaceId : 1e48d0dd-77b1-4dcd-9178-257fc511832c
TargetMailbox :
Success : True
TargetFolder :
ResultItemsCount : 0
ResultItemsSize : 0 B (0 bytes)
When i'm changed EstimateResultOnly to DeleteContent, it delete this email in usertest4's mailbox then return result:
RunspaceId : 1e48d0dd-77b1-4dcd-9178-257fc511832c
TargetMailbox :
Success : True
TargetFolder :
ResultItemsCount : 1
ResultItemsSize : 6.799 KB (6,962 bytes)
Something wrong here?
Why EstimateResultOnly return 0 but DeleteContent return 1?

Related

How can I fix the Error of MSC Bootloader with ATxmega32a4?

I'm trying to upload a .hex file via Uart into an ATxmega32a4. I'm using BASCOM IDE and Programmed my MCU with the sample code which is available in sample folder of Bascom (I have attached my code). So I'm using MSC Bootloader Wizard in Bascom to upload my code but unfortunately it has error 6006. I increased timeout but the problem is not fixed.
I monitored serial port as you can find it in attachments.
Could anyone help?
'----------------------------------------------------------------
' (c) 1995-2020, MCS
' BootloaderXmega32A4.bas
' This sample demonstrates how you can write your own bootloader
' in BASCOM BASIC for the XMEGA
'-----------------------------------------------------------------
'The loader is supported from the IDE
$crystal = 29491200 ' xmega128 is running on 32 MHz
$regfile = "xm32a4def.dat"
$hwstack = 40
$swstack = 40
$framesize = 40
'first enabled the osc of your choice
''Config Osc = Disabled , 32mhzosc = Enabled 'internal 2 MHz and 32 MHz enabled
Config Osc = Enabled , 32mhzosc = Enabled , Extosc = Enabled
'configure the systemclock
''Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1 ' we will use 32 MHz and divide by 1 to end up with 32 MHz
Config Sysclock = External , Prescalea = 1 , Prescalebc = 1_1
$loader = &H4000 ' bootloader starts after the application
'this sample uses 38400 baud. To be able to use the Xplain which has a bootloader working at 9600 baud you need to use 9600 baud
''Config Com1 = 38400 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8 ' use USART C0
'COM0-USARTC0, COM1-USARTC2, COM2-USARTD0. etc.
''Config Portc.3 = Output 'define TX as output
''Config Pinc.2 = Input
Config Com3 = 115200 , Mode = Asynchroneous , Parity = EVEN , Stopbits = 1 , Databits = 8
Open "COM3:" For Binary As #1
Config PortD.3 = Output 'define TX as output
Config PinD.2 = Input
Const Maxwordbit = 7 ' Z7 is maximum bit '
Const Maxword =(2 ^ Maxwordbit) * 2 '128
Const Maxwordshift = Maxwordbit + 1
Const Cdebug = 0 ' leave this to 0
'Dim the used variables
Dim Bstatus As Byte , Bretries As Byte , Bmincount As Byte , Bblock As Byte , Bblocklocal As Byte
Dim Bcsum1 As Byte , Bcsum2 As Byte , Buf(128) As Byte , Csum As Byte
Dim J As Byte , Spmcrval As Byte ' self program command byte value
Dim Z As Long 'this is the Z pointer word
Dim Vl As Byte , Vh As Byte ' these bytes are used for the data values
Dim Wrd As Word , Page As Word 'these vars contain the page and word address
Disable Interrupts 'we do not use ints
'We start with receiving a file. The PC must send this binary file
'some constants used in serial com
Const Nak = &H15
Const Ack = &H06
Const Can = &H18
$timeout = 300000 'we use a timeout
'When you get LOADER errors during the upload, increase the timeout value
'for example at 16 Mhz, use 200000
Bretries = 5 : Bmincount = 3 'we try 10 times and want to get 123 at least 3 times
Do
Bstatus = Waitkey(#1) 'wait for the loader to send a byte
If Bstatus = 123 Then 'did we received value 123 ?
If Bmincount > 0 Then
Decr Bmincount
Else
Print #1, Chr(bstatus);
Goto Loader ' yes so run bootloader
End If
Else 'we received some other data
If Bretries > 0 Then 'retries left?
Bmincount = 3
Decr Bretries
Else
Rampz = 0
Goto Proces_reset 'goto the normal reset vector at address 0
End If
End If
Loop
'this is the loader routine. It is a Xmodem-checksum reception routine
Loader:
Do
Bstatus = Waitkey(#1)
Loop Until Bstatus = 0
Spmcrval = &H20 : Gosub Do_spm ' erase all app pages
Bretries = 10 'number of retries
Do
Csum = 0 'checksum is 0 when we start
Bblocklocal = 1
Print #1, Chr(bstatus); ' firt time send a nack
Do
Bstatus = Waitkey(#1) 'wait for statuse byte
Select Case Bstatus
Case 1: ' start of heading, PC is ready to send
Csum = 1 'checksum is 1
Bblock = Waitkey(#1) : Csum = Csum + Bblock 'get block
Bcsum1 = Waitkey(#1) : Csum = Csum + Bcsum1 'get checksum first byte
For J = 1 To 128 'get 128 bytes
Buf(j) = Waitkey(#1) : Csum = Csum + Buf(j)
Next
Bcsum2 = Waitkey(#1) 'get second checksum byte
If Bblocklocal = Bblock Then 'are the blocks the same?
If Bcsum2 = Csum Then 'is the checksum the same?
Gosub Writepage 'yes go write the page
Print #1, Chr(bstatus); 'acknowledge
Incr Bblocklocal 'increase local block count
Else 'no match so send nak
Print #1, Chr(bstatus);
End If
Else
Print #1, Chr(bstatus); 'blocks do not match
End If
Case 4: ' end of transmission , file is transmitted
If Wrd > 0 Then 'if there was something left in the page
Wrd = 0 'Z pointer needs wrd to be 0
Spmcrval = &H24 : Gosub Do_spm 'write page
End If
Print #1, Chr(bstatus); ' send ack and ready
Waitms 20
Goto Proces_reset
Case &H18: ' PC aborts transmission
Goto Proces_reset ' ready
Case 123 : Exit Do 'was probably still in the buffer
Case 124 : Exit Do
Case Else
Exit Do ' no valid data
End Select
Loop
If Bretries > 0 Then 'attempte left?
Waitms 1000
Decr Bretries 'decrease attempts
Else
Goto Proces_reset 'reset chip
End If
Loop
'write one or more pages
Writepage:
For J = 1 To 128 Step 2 'we write 2 bytes into a page
Vl = Buf(j) : Vh = Buf(j + 1) 'get Low and High bytes
!lds r0, {vl} 'store them into r0 and r1 registers
!lds r1, {vh}
Spmcrval = &H23 : Gosub Do_spm 'write value into page at word address
Wrd = Wrd + 2 ' word address increases with 2 because LS bit of Z is not used
If Wrd = Maxword Then ' page is full
Wrd = 0 'Z pointer needs wrd to be 0
Spmcrval = &H24 : Gosub Do_spm 'write page
Page = Page + 1 'next page
End If
Next
Return
Do_spm:
Z = Page 'make equal to page
Shift Z , Left , Maxwordshift 'shift to proper place
Z = Z + Wrd 'add word
!lds r30,{Z}
!lds r31,{Z+1}
#if _romsize > 65536
!lds r24,{Z+2}
!sts rampz,r24 ' we need to set rampz also for the M128
#endif
Nvm_cmd = Spmcrval
Cpu_ccp = &H9D
!spm 'this is an asm instruction
Do_spm_busy:
!lds r23, NVM_STATUS
!sbrc r23,7 ;if busy bit is cleared skip next instruc tion
!rjmp do_spm_busy
Return
Proces_reset:
Rampz = 0
Goto _reset 'start at address 0

switch port for ipp printer

I need to change the port of an ipp printer using powershell or any other form of command/script
I tried to create and switch Port like this:
Add-PrinterPort -name "newport" --PrinterHostAddress "http://{the new ip}"
Set-Printer -name "myPrinterName" -PortName "newPort"
but the printer doesn't get the new printing jobs after this.
I checked and the old port and the new port are different,
the command Get-PrinterPort | select * shows this for the two port:
Caption :
Description : Internet Port
ElementName :
InstanceID :
CommunicationStatus :
DetailedStatus :
HealthState :
InstallDate :
Name : http://{the printer ip}
OperatingStatus :
OperationalStatus :
PrimaryStatus :
Status :
StatusDescriptions :
ComputerName :
PortMonitor : Internet Port
PSComputerName :
CimClass : ROOT/StandardCimv2:MSFT_PrinterPort
CimInstanceProperties : {Caption, Description, ElementName, InstanceID...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
Protocol : RAW
Caption :
Description : Standard TCP/IP Port
ElementName :
InstanceID :
CommunicationStatus :
DetailedStatus :
HealthState :
InstallDate :
Name : newPort
OperatingStatus :
OperationalStatus :
PrimaryStatus :
Status :
StatusDescriptions :
ComputerName :
PortMonitor : TCPMON.DLL
LprByteCounting : False
LprQueueName :
PortNumber : 9100
PrinterHostAddress : {the new ip address}
PrinterHostIP :
SNMPCommunity :
SNMPEnabled : False
SNMPIndex : 0
PSComputerName :
CimClass : ROOT/StandardCimv2:MSFT_TcpIpPrinterPort
CimInstanceProperties : {Caption, Description, ElementName, InstanceID...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
How can I create a new "internet port" ?
I checked all the docs,forums,etc.. I could but didn't find anything about it.
I know the "internet Port" is created automatically when i created my printer with this command: Add-Printer -Name "myPrinter" -DriverName "driverName" -PortName "http://{the ip for the printer}"

Path.getNameCount returns 1 if even if Path.get("") is just an empty string

It really does not makes sense why the console output is a bit inconsistent for Path.getNameCount whenever Path.get("").getNameCount() returns 1 wherein I expect it to be 0, when I use Path.get("C:\").getNameCount() returns 0 -> this one works as expected. I read the javadoc, there not much of an intuitive info about what happen so I have to ask is this something that needs fixing in java se? or I am missing something?
From java doc:
int getNameCount()
Returns the number of name elements in the path.
Returns:
the number of elements in the path, or 0 if this path only represents a root component
//omitted codes
print(Paths.get(""));
print(Paths.get("C:"));
print(Paths.get("C:\\"));
//omitted codes
public static void print(Path path) {
System.out.println("~~~~~~~ " + path + " ~~~~~~~");
System.out.println("getRoot : " + path.getRoot());
System.out.println("getParent : " + path.getParent());
System.out.println("getFileName : " + path.getFileName());
int nameCount = path.getNameCount();
System.out.println("getNameCount : " + nameCount);
if (nameCount > 1) {
IntStream.range(0,nameCount).forEach(x->{
System.out.println("getName(" + x + ") : " + path.getName(x) + "\t");
});
}
}
//omitted codes
Console Output:
~~~~~~~ ~~~~~~~
getRoot : null
getParent : null
getFileName :
getNameCount : 1
~~~~~~~ C: ~~~~~~~
getRoot : C:
getParent : null
getFileName : null
getNameCount : 0
~~~~~~~ C:\ ~~~~~~~
getRoot : C:\
getParent : null
getFileName : null
getNameCount : 0
Thanks to #Thilo, I realized that Paths.get("") is equivalent to the default directory or the current directory and as per specification I wont get 0 from getNameCount but 1, so I ran some test
System.out.println("isAbsolute : " + path.isAbsolute());
System.out.println("toAbsolutePath : " + path.toAbsolutePath());
console output:
isAbsolute : false
toAbsolutePath : C:\Users\user\Documents\java\NIO
so there, that makes sense now.is was never an empty path after all, but ofcourse toAbsolutePath return new Path object and is not equal to the original Path("")

DB2 10.1 FP4 DB2START gives error

I installed DB2 10.1 FP4 on Windows server 2012 R2 successfully.
When I try to start database using db2start I am getting below error.
DB2 : The service has returned a service-specific error code.
SQL1042C An unexpected system error occurred. SQLSTATE=58004
db2diag.log has below error.
2015-05-14-16.34.51.630000+540 I95881F1126 LEVEL: Error
PID : 4728 TID : 4996 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
HOSTNAME: <Machine name>
EDUID : 4996 EDUNAME: db2sysc
FUNCTION: DB2 Common, Cryptography, cryptDynamicLoadGSKitCrypto, probe:998
MESSAGE : ECF=0x90000076=-1879048074=ECF_LIB_CANNOT_LOAD
Cannot load the specified library
DATA #1 : unsigned integer, 4 bytes
70
DATA #2 : String, 48 bytes
D:\PROGRA~1\IBM\SQLLIB\bin\icc64\gsk8iccs_64.dll
CALLSTCK:
[0] 0x00007FF93D9642A4 pdOSSeLoggingCallback + 0x134
[1] 0x00007FF93EF1033E ossLog + 0x15E
[2] 0x00007FF93EF1023B ossLog + 0x5B
[3] 0x00007FF91D8E75ED cryptDynamicLoadGSKitCrypto + 0x65D
[4] 0x00007FF91D8E6724 cryptContextRealInit + 0x144
[5] 0x00007FF91D8E6337 cryptContextInit + 0x117
[6] 0x00007FF91C9002E5 sqloRunInstance + 0x1C5
[7] 0x00007FF691442700 0x00007FF691442700 + 0x0
[8] 0x00007FF691441974 0x00007FF691441974 + 0x0
[9] 0x00007FF946B516AD BaseThreadInitThunk + 0xD
[10] 0x00007FF946D04629 RtlUserThreadStart + 0x1D
2015-05-14-16.34.51.834000+540 I97009F922 LEVEL: Error
PID : 4728 TID : 4996 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
HOSTNAME: <Machine name>
EDUID : 4996 EDUNAME: db2sysc
FUNCTION: DB2 Common, Cryptography, cryptContextInit, probe:105
MESSAGE : ECF=0x90000076=-1879048074=ECF_LIB_CANNOT_LOAD
Cannot load the specified library
DATA #1 : Hex integer, 4 bytes
0x90000076
CALLSTCK:
[0] 0x00007FF93D9642A4 pdOSSeLoggingCallback + 0x134
[1] 0x00007FF93EF1033E ossLog + 0x15E
[2] 0x00007FF93EF1023B ossLog + 0x5B
[3] 0x00007FF91D8E63D5 cryptContextInit + 0x1B5
[4] 0x00007FF91C9002E5 sqloRunInstance + 0x1C5
[5] 0x00007FF691442700 0x00007FF691442700 + 0x0
[6] 0x00007FF691441974 0x00007FF691441974 + 0x0
[7] 0x00007FF946B516AD BaseThreadInitThunk + 0xD
[8] 0x00007FF946D04629 RtlUserThreadStart + 0x1D
2015-05-14-16.34.51.834000+540 I97933F426 LEVEL: Severe
PID : 4728 TID : 4996 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
HOSTNAME: <Machine name>
EDUID : 4996 EDUNAME: db2sysc
FUNCTION: DB2 UDB, oper system services, sqloRunInstance, probe:50
MESSAGE : ECF=0x90000076=-1879048074=ECF_LIB_CANNOT_LOAD
Cannot load the specified library
2015-05-14-16.34.51.834000+540 I98361F529 LEVEL: Severe
PID : 4728 TID : 4996 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000
HOSTNAME: <Machine name>
EDUID : 4996 EDUNAME: db2sysc
FUNCTION: DB2 UDB, base sys utilities, DB2main, probe:2263
MESSAGE : SQL1042C An unexpected system error occurred.
Any help is appreciate.

.net memory usage reporting difference between task manager and windbg/sos

I have a .net application. In task manager it showing 249 MB usage in Memory (private working set) column. Then I attach windb and ran !address –summary command. Below is its result. The memory usage its showing in .NET heap(RegionUsageIsVAD) is 568 MB.
Should these two values be same? Can anyone explain why is so much difference between the two values?
-------------------- Usage SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Pct(Busy) Usage
22b7c000 ( 568816) : 27.12% 64.42% : RegionUsageIsVAD
4a1b3000 ( 1214156) : 57.90% 00.00% : RegionUsageFree
e8e6000 ( 238488) : 11.37% 27.01% : RegionUsageImage
1c00000 ( 28672) : 01.37% 03.25% : RegionUsageStack
0 ( 0) : 00.00% 00.00% : RegionUsageTeb
2dda000 ( 46952) : 02.24% 05.32% : RegionUsageHeap
0 ( 0) : 00.00% 00.00% : RegionUsagePageHeap
1000 ( 4) : 00.00% 00.00% : RegionUsagePeb
0 ( 0) : 00.00% 00.00% : RegionUsageProcessParametrs
0 ( 0) : 00.00% 00.00% : RegionUsageEnvironmentBlock
Tot: 7fff0000 (2097088 KB) Busy: 35e3d000 (882932 KB)
-------------------- Type SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
4a1b3000 ( 1214156) : 57.90% :
11ce9000 ( 291748) : 13.91% : MEM_IMAGE
9fe9000 ( 163748) : 07.81% : MEM_MAPPED
1a16b000 ( 427436) : 20.38% : MEM_PRIVATE
-------------------- State SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
2e2a0000 ( 756352) : 36.07% : MEM_COMMIT
4a1b3000 ( 1214156) : 57.90% : MEM_FREE
7b9d000 ( 126580) : 06.04% : MEM_RESERVE
Largest free region: Base 32ce9000 - Size 15377000 (347612 KB)
!address is just showing you address space usage. Some of the memory is paged out. The working set (memory actually paged in and in use) is much smaller.

Resources