Let $G=H\times J$, where $H\cong J\cong C_2$ (cyclic group of order 2). Let $M \cong \mathbb{Z}$ be a $G$-module via "trivial $H$-action and negation $J$-action". My question is "What are the group cohomologies $H^*(G,M)$?"

I tried to compute them via the Hochschild-Serre spectral sequence $E_2^{p,q}=H^p(J,H^q(H,M))$. The computation of each term is easy, but I don't have any information about arrows and cannot determine $H^*(G,M)$.

More generally, let $G=C_k\rtimes C_2$ be a dihedral group and $M \cong \mathbb{Z}$ a $G$-module via "trivial $C_k$-action and negation $C_2$-action". Can one compute the group cohomologies $H^*(G,M)$?

I would appreciate it if you could provide an explicit computation, or a reference where I can find one. Thank you very much in advance.